Skip to content

Negation and whitespace

Compare
Choose a tag to compare
@biggianteye biggianteye released this 04 Jul 13:26
a90e559

Adds a new sniff (Graze\Sniffs\ControlStructures\NegationNoSpacesSniff) to check for the following rule:

'Not' logical operators MUST NOT have whitespace between them and the subject being negated.

This means that the following will now produce an error:

$foo = ! $bar;

This can be fixed by removing the whitespace:

$foo = !$bar;