Skip to content

Commit

Permalink
[Scoped] Fix downgrade AsciiSlugger (#1349)
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Nov 30, 2021
1 parent 07de4ed commit bc96dde
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion build/config/config-downgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ final class DowngradeRectorConfig
// loaded with "require-dev" so it'd throw an error

// use relative paths, so files are excluded on nested directory too
'vendor/symfony/string/Slugger/AsciiSlugger.php',
'vendor/symfony/cache/*',
// no event-dispatcher used
'vendor/symfony/console/Event/*',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,13 @@ private function isBetweenParentheses(Node $node): ?bool
$token = $oldTokens[$previousTokenPos] ?? null;
--$previousTokenPos;

if (isset($token[0]) && in_array($token[0], [\T_COMMENT, \T_WHITESPACE], true)) {
continue;
if (! isset($token[0])) {
return $token === '(';
}

return $token === '(';
if (! in_array($token[0], [\T_COMMENT, \T_WHITESPACE], true)) {
return $token === '(';
}
}

return false;
Expand Down

0 comments on commit bc96dde

Please sign in to comment.