Problem/Motivation

As per https://www.drupal.org/node/3395582 not providing an attribute class is deprecated in 11.2

If we raise the minimum supported version to 10.2 then we can safely remove the annotations.

Steps to reproduce

N/A

Proposed resolution

  • Add 7 new PHP 8 attribute classes in src/Attribute/ (one for each plugin type)
  • Update all 7 plugin managers to support both attributes and annotations for backward compatibility
  • Convert all core and test module plugins from annotations to attributes
  • Preserve existing annotation classes in src/Annotation/ so contrib modules can migrate at their own pace

Remaining tasks

Do it

User interface changes

N/A

API changes

Annotations removed, attributes added.

Data model changes

N/A

Issue fork purge-3556305

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

acbramley created an issue. See original summary.

kim.pepper made their first commit to this issue’s fork.

kim.pepper’s picture

Status: Active » Needs review

I created a MR for this. I used Claude code to help automate the conversion of annotations to attributes.

I also added the #[RunTestsInSeparateProcesses] attribute for all Kernel tests as this is now required for PHPUnit 12.

kim.pepper’s picture

Issue summary: View changes
kim.pepper’s picture

If we raise the minimum supported version to 10.2 then we can safely remove the annotations.

Security support for 10.2 ended 1 year and 4 months ago (17 Dec 2024)

kim.pepper’s picture

Some of the test fails are due to deprecations. I created https://www.drupal.org/project/purge/issues/3587982 to deal with that.

kim.pepper’s picture

Rebased on 8.x-3.x