Closed sirbrillig closed 4 years ago
@sirbrillig If you'd consider adding PHPCSUtils
as a dependency, it contains a Lists::getAssignments()
utility method which would be very helpful to solve this: https://github.com/PHPCSStandards/PHPCSUtils/blob/a9ee9e0afffca398df6f997b44628440aa838d41/PHPCSUtils/Utils/Lists.php#L221-L277
I created this utility method so sniffs like the WPCS PrefixAllGlobals
and GlobalVariablesOverride
will be able to detect variable assignments in lists more easily.
I'd be happy to add that as a dependency. Thanks for all the work you've done there. I just need to find the time...
Added phpcsutils in #129. Very helpful!
@sirbrillig :+1: Nice! I'm travelling for a conference at the moment, but will have a look at it when I can ;-)
Note: PHPCSUtils is on an alpha release at this moment, so some implementation details may still change before the final 1.0.0 release, though I will make sure that if they do they will be annotated well in the changelog.
Same issue as this one in VIPCS: https://github.com/Automattic/VIP-Coding-Standards/issues/458