DateFuncCallToCarbonRector

Convert date() function call to Carbon::now()->format(*)

 class SomeClass
 {
     public function run()
     {
-        $date = date('Y-m-d');
+        $date = \Carbon\Carbon::now()->format('Y-m-d');
     }
 }

Configure your rector.php:

<?php

use Rector\Carbon\Rector\FuncCall\DateFuncCallToCarbonRector;
use Rector\Config\RectorConfig;

return RectorConfig::configure()
    ->withRules([
        DateFuncCallToCarbonRector::class,
    ]);