I prefer using regular style in my project, and i set inspection "Yoda/regular conditions style usage" to "prefer regular style".
I picked "Suggest to use null-comparison" inside 'empty(..) usage' inspection.
And when i choose auto resolving issue, than it fixes via yoda style
Initial state:
~php
if (empty($foo)) {
return null;
}
~
After autofixing
~php
if (null === $foo) {
return null;
}
~
The Yoda/Classic style fixing settings are not applied to other inspections (is_null, isset has individual fixing options). This one will get also individual, when I have time, we'll introduce plugin-wide settings for this, but currently only individual will work.
Implemented
Most helpful comment
The Yoda/Classic style fixing settings are not applied to other inspections (is_null, isset has individual fixing options). This one will get also individual, when I have time, we'll introduce plugin-wide settings for this, but currently only individual will work.