Skip to content

Conversation

@sirbrillig
Copy link
Owner

@sirbrillig sirbrillig commented Feb 11, 2020

Props to @dlh01 in Automattic/VIP-Coding-Standards#458 who noticed the bug in a different sniff but it's totally applicable here too.

Fixes #130

@sirbrillig sirbrillig force-pushed the nested-destructuring-assignment branch from 288d02a to 06e8d9b Compare February 27, 2020 18:27
@sirbrillig sirbrillig marked this pull request as ready for review February 27, 2020 18:28
@sirbrillig
Copy link
Owner Author

This could even be simplified further since getAssignments can operate on both short and long lists, but this will get the bug fixed for now.

It shouldn't be able to fail since we already search for the opening
bracket, but it seems to fail in CI.
This will never happen but the return type can include `true` so we must
look for it to satisfy the static analysis.
The comparison with true was sometimes breaking phpstan.
@sirbrillig sirbrillig merged commit 4e80fc1 into master Feb 27, 2020
@sirbrillig sirbrillig deleted the nested-destructuring-assignment branch February 27, 2020 18:54
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.

Nested destructured assignment reported as unused/undefined

2 participants