Annotation to PHP Attributes conversion

Created on 13 August 2025, about 2 months ago

Problem/Motivation

Multiple things are moving to PHP Attributes. Plugins, Entities, REST resources, PHPUnit. Maybe a few more things. Let's convert to PHP Attributes in a BC manner so we still support Drupal 10.3, but also set ourselves up well for Drupal 12 or 13 when Attributes are the only supported mechanism.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

6.0

Component

API

Created by

heddn Nicaragua

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @heddn
  • @heddn opened merge request.
  • heddn Nicaragua

    Thanks to Tag1 for providing a small budget to explore AI. I used Claude mainly. Initially I asked it to convert all the things. That seemed too much in one pass. So then I asked it to suggest a Rector configuration that would help here. It did a decent job, but then I was still left with fully importing class names manually. Of note, rector didn't seem to want to update/convert all of the PHPUnit attributes. I tried to convince it, even pulled out xdebug to see why it was ignoring some of the conversions for the @covers* cases. But to keep thing moving (and so I didn't fall prey to the issue where AI actually _slows_ things down) I opted use PHPStorm's automation to quickly and manually convert the few remaining phpunit annotations.

Production build 0.71.5 2024