Active
Project:
Coder
Version:
8.3.x-dev
Component:
Coder Sniffer
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
13 May 2024 at 15:08 UTC
Updated:
25 Aug 2025 at 08:49 UTC
Jump to comment: Most recent
The Drupal.Arrays.Array.LongLineDeclaration sniff detects an array declaration that's in a single line.
But there's no rule that picks up a long attribute declaration, e.g.
#[\Drupal\computed_field\Attribute\ComputedField(id: 'test_string_automatic_base', label: new TranslatableMarkup('Test String Automatic'), field_type: 'string', no_ui: TRUE, attach: ['scope' => 'base', 'field_name' => 'test_automatic_base', 'entity_types' => ['entity_test_with_bundle' => []]])]
Comments
Comment #2
joachim commentedThis would be really useful to have for converting annotation plugins to use attributes.
The conversion to an annotation can be done with Rector, but it produces an attribute that's a single long line.