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
Ability to set array values using phpcs:set #1999
Ability to set array values using phpcs:set #1999
Conversation
@gsherwood Any chance to have it merged into 3.3.0 release? I need this to test my custom sniff with array properties. Or maybe there is another way to do it? Thanks! |
Because of hotfix #2004 probably this is not gonna work to set empty value. Maybe we should allow just: // phpcs:set Squiz.PHP.SniffName property[] (so no value provided) and it will mean to set empty value ( |
Property name should be with [] and values must be comma separated. If we want provide also array keys we need to separate them with =>. So the format is the same as the one possible format in ruleset, i.e.: // phpcs:set Squiz.PHP.SniffName property[] key=>value,key2=>value2
320e951
to
7575ad9
Compare
Rebased with base #2004. // phpcs:set Squiz.PHP.SniffName property[] and // phpcs:set Squiz.PHP.SniffName property (so there is no value at all, it means to set empty value). |
Thanks a lot for this change |
Property name should be with
[]
and values must be comma separated.If we want provide also array keys we need to separate them with
=>
.So the format is the same as the one possible format in ruleset, i.e.:
// phpcs:set Squiz.PHP.SniffName property[] key=>value,key2=>value2