Changes multiple dirname() calls to one with nesting level
-dirname(dirname($path));
+dirname($path, 2);
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\Php70\Rector\FuncCall\MultiDirnameRector;
return RectorConfig::configure()
->withRules([
MultiDirnameRector::class,
]);