Skip to content

Commit a13d7a6

Browse files
committed
clean up
1 parent cb3f65e commit a13d7a6

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

rules/Php81/NodeManipulator/AttributeGroupNewLiner.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ public function newLine(File $file, Node $node): void
4949
}
5050

5151
$nextTokenText = $oldTokens[$startTokenPos + $iteration + 1]->text ?? '';
52-
// when trimmed is empty string, but it contains new line
53-
if (trim($nextTokenText) === '' && str_contains($nextTokenText, "\n")) {
54-
break;
55-
}
56-
5752
if (trim($nextTokenText) === '') {
53+
// when trimmed is empty string, but it contains new line
54+
if (str_contains($nextTokenText, "\n") || str_contains($nextTokenText, "\r")) {
55+
break;
56+
}
57+
5858
$space = ltrim($nextTokenText, "\r\n");
5959
} elseif (trim($oldTokens[$startTokenPos - 1]->text ?? '') === '') {
6060
$space = ltrim($oldTokens[$startTokenPos - 1]->text ?? '', "\r\n");

0 commit comments

Comments
 (0)