PHP_CodeSniffer
PHP_CodeSniffer copied to clipboard
Sniffs for comparison operators
I want to make sure, my code always has Identical used, when using comparison operators
so this is false:
$a == $b
this is correct
$a === $b
so instead of re-inventing the wheel, is there some sniff available for that? I checked the available rules but was not lucky.
@Kifah check this out: https://github.com/squizlabs/PHP_CodeSniffer/blob/master/src/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php
Squiz.Operators.ComparisonOperatorUsage is what you are looking for!
thank you. I also found this: https://github.com/slevomat/coding-standard which is pretty useful as well.