DirNameFileConstantToDirConstantRector

Convert dirname(__FILE__) to __DIR__

 class SomeClass
 {
     public function run()
     {
-        return dirname(__FILE__);
+        return __DIR__;
     }
 }

Configure your rector.php:

<?php

use Rector\Config\RectorConfig;
use Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector;

return RectorConfig::configure()
    ->withRules([
        DirNameFileConstantToDirConstantRector::class,
    ]);
SETS:  PHP 5.3