TernaryToNullsafeCoalesceRector
Change null check ternary around a method call or property fetch to nullsafe operator
-$value = null !== $dateTime ? $dateTime->format('d/m/Y') : '';
+$value = $dateTime?->format('d/m/Y') ?? '';
Configure your rector.php:
<?php
use Rector\Config\RectorConfig;
use Rector\Php80\Rector\Ternary\TernaryToNullsafeCoalesceRector;
return RectorConfig::configure()
->withRules([
TernaryToNullsafeCoalesceRector::class,
]);