Make if conditions more explicit
final class SomeController
{
public function run($items)
{
- if (!count($items)) {
+ if (count($items) === 0) {
return 'no items';
}
}
}
Configure your rector.php
:
<?php
use Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector;
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withRules([
ExplicitBoolCompareRector::class,
]);