add a way to sniff/fix fully-qualified attribute classes

Created on 3 February 2025, 2 months ago

Problem/Motivation

Coder does not check for namespaces in PHP attributes -- this issue 🐛 Drupal.Classes.FullyQualifiedNamespace sniff doesn't work with attributes Active tried to add that to Drupal.Classes.FullyQualifiedNamespace and ran into problems because Drush code style specifically uses namespace in its command attribute classes.

However, being able to detect and fix fully-qualified classnames in attribute classes is a key part of upgrading plugin annotations to attributes.

Steps to reproduce

Proposed resolution

Either:

- provide an additional sniff for FQCNs in attribute classes, which is not in the Drupal set, but can be used by module developers when upgrading their plugin classes
- use a config option in Drupal.Classes.FullyQualifiedNamespace that users can switch on to check and fix full namespaces in attributes.

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

8.3

Component

Review/Rules

Created by

🇬🇧United Kingdom joachim

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

Comments & Activities

Production build 0.71.5 2024