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

AbstractFunctionCallParameter: prevent false positives on PHP 8.0+ attributes #1596

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Aug 4, 2023

T_STRING tokens in PHP 8.0+ attributes are either class names or possibly constant names (as a parameter for the class instantiation). They are never function calls (as things are).

This commit ensures that T_STRING tokens in attributes are not confused with function calls for all sniffs based on the AbstractFunctionCallParameterSniff class.

…tributes

`T_STRING` tokens in PHP 8.0+ attributes are either class names or possibly constant names (as a parameter for the class instantiation).
They are never function calls (as things are).

This commit ensures that `T_STRING` tokens in attributes are not confused with function calls.
@jrfnl jrfnl added bug PR: quick merge PR only contains relatively simple changes PR: ready for review labels Aug 4, 2023
@jrfnl jrfnl added this to the 10.0.0 milestone Aug 4, 2023
@jrfnl jrfnl requested a review from wimg August 4, 2023 19:59
@wimg wimg merged commit ef51479 into develop Aug 4, 2023
43 checks passed
@wimg wimg deleted the feature/abstractfunctionparamsniff-prevent-false-positives-on-attributes branch August 4, 2023 21:48
@github-actions github-actions bot removed PR: ready for review PR: quick merge PR only contains relatively simple changes labels Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants