Flip negated ternary of instanceof to direct use of object
-echo ! $object instanceof Product ? null : $object->getPrice();
+echo $object instanceof Product ? $object->getPrice() : null;
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\Instanceof_\Rector\Ternary\FlipNegatedTernaryInstanceofRector;
return RectorConfig::configure()
->withRules([
FlipNegatedTernaryInstanceofRector::class,
]);