Skip to content

Commit

Permalink
SingleSpaceAfterConstructFixer - better handling of closing parenthes…
Browse files Browse the repository at this point in the history
…is and brace
  • Loading branch information
keradus committed Jan 19, 2021
1 parent df85dd6 commit 6d12e93
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens)

$whitespaceTokenIndex = $index + 1;

if ($tokens[$whitespaceTokenIndex]->equalsAny([';', ')'])) {
if ($tokens[$whitespaceTokenIndex]->equalsAny([';', ')', [CT::T_ARRAY_SQUARE_BRACE_CLOSE]])) {
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3178,6 +3178,7 @@ public function provideCommentsCases()
new Dummy(/* a */);
new Dummy(/** b */);
foo(/* c */);
$arr = [/* empty */];
',
];
}
Expand Down

0 comments on commit 6d12e93

Please sign in to comment.