Problem/Motivation

If you scan this module with Upgrade Status in Drupal 11, you see many warnings of the form, "Unsafe usage of new static()." While those were tolerated in Drupal 10, we have better options now.

Steps to reproduce

Use Upgrade Status module to scan this module.

Proposed resolution

Where autowiring is an option now, use that. Where it's not, use the $instance = parent::create() pattern, or new self() instead of static().

Remaining tasks

Make an MR. I'm assigning this to myself since I intend to work on it right away.

Issue fork tamper-3593779

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

benstallings created an issue. See original summary.

benstallings’s picture

Assigned: benstallings » Unassigned
Status: Active » Needs review

mandclu made their first commit to this issue’s fork.

mandclu’s picture

Status: Needs review » Fixed

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.