Remove is_
class SomeClass
{
public function run(?string $value, array $items)
{
- if ($value === null || ! is_string($value)) {
+ if ($value === null) {
return;
}
- if ($items && is_array($items)) {
+ if ($items) {
return;
}
}
}
Configure your rector.php:
<?php
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\BinaryOp\RemoveRedundantTypeCheckRector;
return RectorConfig::configure()
->withRules([
RemoveRedundantTypeCheckRector::class,
]);