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
it works fine:
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
Post a Comment