diff --git a/rules/DowngradePhp80/Rector/New_/DowngradeArbitraryExpressionsSupportRector.php b/rules/DowngradePhp80/Rector/New_/DowngradeArbitraryExpressionsSupportRector.php index 8432a820..de5e9ca5 100644 --- a/rules/DowngradePhp80/Rector/New_/DowngradeArbitraryExpressionsSupportRector.php +++ b/rules/DowngradePhp80/Rector/New_/DowngradeArbitraryExpressionsSupportRector.php @@ -109,12 +109,12 @@ private function isBetweenParentheses(Node $node): bool $token = $oldTokens[$previousTokenPos] ?? null; --$previousTokenPos; - if (! isset($token[0])) { - return $token === '('; + if ((string) $token === '(') { + return true; } - if (! in_array($token[0], [\T_COMMENT, \T_WHITESPACE], true)) { - return $token === '('; + if (! in_array((string) $token, [\T_COMMENT, \T_WHITESPACE], true)) { + continue; } }