Fixer for PHPStan reports by strict type rule - "PHPStan\Rules\DisallowedConstructs\DisallowedEmptyRule"
final class SomeEmptyArray
{
public function run(array $items)
{
- return empty($items);
+ return $items === [];
}
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector;
return RectorConfig::configure()
->withConfiguredRule(DisallowedEmptyRuleFixerRector::class, [
'treat_as_non_empty' => false,
]);