False positives for intersection types in function parameters

Created on 2 June 2023, about 1 year ago
Updated 9 June 2023, about 1 year ago

Problem/Motivation

Sorta similar to πŸ› `Drupal.Commenting.FunctionComment.InvalidReturn` breaks on intersection return type annotations Fixed , Coder does not like intersection types (I think I incorrectly called these union types in the other issue) for function parameters. E.g.

  /**
   * Add an event for processing.
   *
   * @param \Br33f\Ga4\MeasurementProtocol\Dto\Event\AbstractEvent&\Drupal\user\EntityOwnerInterface $event
   *   The event.
   */
  public function addEvent(AbstractEvent&EntityOwnerInterface $event): void {}

This yields all sorts of noise:

 118 | ERROR | [ ] Parameter $event is not described in comment (Drupal.Commenting.FunctionComment.ParamMissingDefinition)
 121 | ERROR | [x] Expected 1 spaces after parameter type; 0 found (Drupal.Commenting.FunctionComment.SpacingAfterParamType)
 121 | ERROR | [ ] Doc comment for parameter &\Drupal\user\EntityOwnerInterface does not match actual variable name $event
     |       |     (Drupal.Commenting.FunctionComment.ParamNameNoMatch)
 121 | ERROR | [x] Parameter comment must be on the next line (Drupal.Commenting.FunctionComment.ParamCommentNewLine)

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ’¬ Support request
Status

Fixed

Version

8.3

Component

Coder Sniffer

Created by

πŸ‡ΊπŸ‡ΈUnited States bradjones1 Digital Nomad Life

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

Comments & Activities

Production build 0.69.0 2024