UserLoadByNameAndMailRector

Replaces deprecated user_load_by_name() and user_load_by_mail() with entity storage loadByProperties()

-$account = user_load_by_name($name);
+$account = array_values(\Drupal::entityTypeManager()->getStorage('user')->loadByProperties(['name' => $name]))[0] ?? FALSE;

Configure your rector.php:

<?php

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

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

Other rules in the drupal/core 11.4 set