Closed
Description
Since empty arrays always evaluates to false
, these checks can be simplified.
An example from Symfony\Component\Routing\Annotation\Route::setRequirements()
:
// current check
if (0 === count($this->methods)) {
// ...
}
// proposed check
if (!$this->methods) {
// ...
}
NOTE: I've found 54 exact matches for 0 === count(
at 2.7
branch.
Metadata
Metadata
Assignees
Labels
No labels