Phpinspectionsea: 'null === ...' can be used, why not '... === null'?

Created on 31 Aug 2017  路  5Comments  路  Source: kalessil/phpinspectionsea

I think that it is much more common to write$value === null then null === $value.

IMO, this does read much easier. Would it be possible to autofix this the other way around. We got over 400 places where is_null() is used, I want to autofix them all, but would love if it could be done in a more standard way of checking for null values.

enhancement fixed

Most helpful comment

Ready (fresh binary is pushed to the master as well), @kasperpeulen do you need support with installing the dev build?

All 5 comments

I'll add an option for configuring the fix style (Yoda/regular).

EDIT: reason is my personal preferences. The inspection is from times when the plugin was only for my teams.

I'll ping you back when dev-build with the option is avaialble.

thanks 馃檹

Ready (fresh binary is pushed to the master as well), @kasperpeulen do you need support with installing the dev build?

Thanks!

Was this page helpful?
0 / 5 - 0 ratings