-
Notifications
You must be signed in to change notification settings - Fork 13
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
Unused function parameter in lambda function #295
Comments
Interesting! It looks like something to do with the array access which is breaking this. The bug does occur in the expression:
But it does not occur in:
I think that there's a bug in how we detect the scope of an arrow function which contains a bracket. |
#296 should fix this. |
Thanks @sirbrillig - that was a quick fix & release!! |
Turns out the fix was really easy: just stop letting phpcs do its own scope detection for arrow functions. 😁 |
Consider this code:
$type = in_array_cb($_GET['type'], TYPES, fn(&$array, $needle) => $array[2] === $needle);
The parameter
$needle
is marked as an error:The text was updated successfully, but these errors were encountered: