When adding multiple PHP8 attributes to a method, Drupal.Commenting.FunctionComment.Missing is incorrectly triggered

Created on 22 February 2023, over 1 year ago
Updated 4 March 2023, over 1 year ago

Problem/Motivation

Using the latest 8.3.17 version. I'm trying to write a drush 11 command using PHP8 annotations, but PHPCS is telling me I'm missing the function doc comment, despite it being there. Here's the code:

<?php

/**
* Audit entities from an individual bundle.
*/
#[CLI\Command(name: 'ps_access:audit:bundle')]
#[CLI\Argument(name: 'entityType', description: 'The entity type (node or media)')]
#[CLI\Argument(name: 'bundle', description: 'The entity bundle (e.g. node type)')]
#[CLI\Usage(name: 'drush ps_access:audit:bundle media ps_private_document', description: 'Audit the Private Documents media bundle.')]
public function auditBundle(string $entityType, string $bundle): void {
...
}

Steps to reproduce

Add a function like described above.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Closed: duplicate

Version

8.3

Component

Coder Sniffer

Created by

πŸ‡ΊπŸ‡ΈUnited States bkosborne New Jersey, USA

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

Comments & Activities

Production build 0.69.0 2024