1.2.822. No Need For Triple Equal¶
There is no need for the identity comparison when the methods returns the proper type.
<?php
// foo() returns a string.
if ('a' === foo()) {
// doSomething()
}
function foo() : string {
return 'a';
}
?>
1.2.822.1. Specs¶
Short name |
Structures/NoNeedForTriple |
Rulesets |
|
Exakat since |
2.1.4 |
PHP Version |
All |
Severity |
Minor |
Time To Fix |
Quick (30 mins) |
Precision |
Very high |
Available in |