RenameDeprecatedMethodCallRector

Rename method calls whose target method is "@deprecated" and suggests a replacement method on the same class

-$someObject->oldMethod();
+$someObject->newMethod();

Configure your rector.php:

<?php

use Rector\Config\RectorConfig;
use Rector\Renaming\Rector\MethodCall\RenameDeprecatedMethodCallRector;

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