phpinspectionsea
phpinspectionsea copied to clipboard
[FR] Nested assignments usage: scalar assignments
Description (screenshot):
For the following code:
$foo = $bar = false;
If we apply the quick fix of the "Nested assignments usage" inspection we get this result:
$bar = false;
$foo = $bar;
While this is the correct meaning of the original statement, it is not very clear. Moreover, for scalar values, it is rarely the meaning the developper put behind that statement (assign multiple values at once to initialize them).
I think this code would be much greater on those levels:
$bar = false;
$foo = false;
However, this can only be applied to scalar values (and null). If it's not possible to make the change for everyone, maybe consider introducing a setting to activate this behaviour?