RemoveModuleHandlerAddModuleCallsRector

Removes deprecated ModuleHandlerInterface::addModule() and addProfile() calls, which are no-ops since drupal:11.2.0 and removed in drupal:12.0.0

-$moduleHandler->addModule('mymodule', 'modules/mymodule');
 $moduleHandler->load('mymodule');

Configure your rector.php:

<?php

use DrupalRector\Drupal11\Rector\Deprecation\RemoveModuleHandlerAddModuleCallsRector;
use Rector\Config\RectorConfig;

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

Other rules in the drupal/core 11.2 set