Phpinspectionsea: Regular style inside "empty() usage"

Created on 13 Nov 2017  路  2Comments  路  Source: kalessil/phpinspectionsea

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;
}
~

enhancement fixed

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.

All 2 comments

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

Was this page helpful?
0 / 5 - 0 ratings