Problem/Motivation

Newer PHPStan rules report direct entity storage injection/property usage and calls to user_load_by_name(), which is deprecated in Drupal 11.4 and removed in Drupal 13.

Proposed resolution

Inject and store EntityTypeManagerInterface, retrieve entity storage at the call site, replace user_load_by_name() with loadByProperties(), and update affected kernel tests accordingly.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

joelpittet created an issue. See original summary.

  • joelpittet committed 93a681ca on 2.1.x
    task: #3616020 Fix PHPStan errors for deprecated user loading and entity...

  • joelpittet committed a08e751b on 3.0.x
    task: #3616020 Fix PHPStan errors for deprecated user loading and entity...
joelpittet’s picture

Status: Needs review » Fixed

Pushed to 3.0.x and 2.1.x branches

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.