Configurable

RenameConstantRector

Replace constant by new ones

 final class SomeClass
 {
     public function run()
     {
-        return MYSQL_ASSOC;
+        return MYSQLI_ASSOC;
     }
 }

Configure your rector.php:

<?php

use Rector\Config\RectorConfig;
use Rector\Renaming\Rector\ConstFetch\RenameConstantRector;

return RectorConfig::configure()
    ->withConfiguredRule(RenameConstantRector::class, [
        'MYSQL_ASSOC' => 'MYSQLI_ASSOC',
    'OLD_CONSTANT' => 'NEW_CONSTANT',
    ]);