Remove dead instanceof check on type hinted variable
function run(stdClass $stdClass)
{
- if (! $stdClass instanceof stdClass) {
- return false;
- }
-
return true;
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\If_\RemoveDeadInstanceOfRector;
return RectorConfig::configure()
->withRules([
RemoveDeadInstanceOfRector::class,
]);