Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DX: FunctionsAnalyzer - simplifying return expression #3897

Merged
merged 1 commit into from Jul 11, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/Tokenizer/Analyzer/FunctionsAnalyzer.php
Expand Up @@ -40,8 +40,7 @@ public function isGlobalFunctionCall(Tokens $tokens, $index)

$nextIndex = $tokens->getNextMeaningfulToken($index);

return !$tokens[$prevIndex]->isGivenKind([T_DOUBLE_COLON, T_NEW, T_OBJECT_OPERATOR, T_STRING, T_FUNCTION])
&& !$tokens[$nextIndex]->isGivenKind([T_DOUBLE_COLON, T_NS_SEPARATOR])
return !$tokens[$prevIndex]->isGivenKind([T_DOUBLE_COLON, T_FUNCTION, T_NEW, T_OBJECT_OPERATOR, T_STRING])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about T_NS_SEPARATOR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's taken care of few lines above.

&& $tokens[$nextIndex]->equals('(');
}

Expand Down