Skip to content

Commit

Permalink
fix: check also for \r\n and \r newline characters in AlphabeticallyO…
Browse files Browse the repository at this point in the history
…rderedConstantsSniff (#118)

Co-authored-by: David Kurka <david.kurka@cdn77.com>
  • Loading branch information
davidxkurka and David Kurka authored Dec 5, 2023
1 parent 7f1ba2d commit bfc8c44
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,10 @@ private function findValue(File $phpcsFile, int $equalsTokenPointer): array|null
$values = [];

while ($valueToken['code'] !== T_SEMICOLON) {
if ($valueToken['code'] === T_WHITESPACE && $valueToken['content'] === "\n") {
if (
$valueToken['code'] === T_WHITESPACE
&& in_array($valueToken['content'], ["\n", "\r\n", "\r"], true)
) {
return null;
}

Expand Down

0 comments on commit bfc8c44

Please sign in to comment.