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

Use custom logic for finding arrow function scope #296

Merged
merged 2 commits into from
Mar 30, 2023

Conversation

sirbrillig
Copy link
Owner

It appears that at least in some versions of phpcs, the arrow function scope detection is not correct. It incorrectly considers a closing square bracket (]) inside the body of an arrow function to close that arrow function's scope.

We already have custom logic for finding arrow function scopes so that it will work for versions of PHP/phpcs which do not support arrow functions. In this PR we remove the simpler path and rely only on the custom logic.

Fixes #295

@sirbrillig sirbrillig merged commit 4cca2aa into 2.x Mar 30, 2023
@sirbrillig sirbrillig deleted the fix-arrow-func-as-arg branch March 30, 2023 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unused function parameter in lambda function
1 participant