Add custom error highlighting in PhpStorm when single equals in php if condition -


yes, using single equals in php if condition desired, how can set custom error in phpstorm on below code prevent me doing so?

mark error when:

if (a = b) {     //crap reassigned when wanted check if == b } 

there inspection -- use it.

settings/preferences | editor | inspections | php | probable bugs -> assignment in condition

enter image description here

it works fine:

enter image description here

severity can changed "warning" "error" if needed.


note:
obviously, highlight such assignments .. not particular place. can create custom scope , turn on or off files in scopes.

for particular place can suppressed via special comment:

/** @noinspection phpassignmentinconditioninspection */ if ($a = $b) {     echo 'hello!'; } 

Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -