Open
Description
I want to report a case that does not seem to be explicitly covered by PSR-12.
It concerns variable destructuring using the list()
and []
syntaxes.
I have this code:
[$val1,$val2] = explode(',', $string);
list($val1,$val2) = explode(',', $string);
And I do not get any error when running the command:
phpcs --standard=PSR12 my-file.php
In my opinion, there should be a space required after the comma following $val1
, as in function calls or arrays.
Correction:
[$val1, $val2] = explode(',', $string);
list($val1, $val2) = explode(',', $string);
Metadata
Metadata
Assignees
Labels
No labels