Allow phpcs:ignore before param comments

Created on 25 May 2025, 8 days ago

Problem/Motivation

This code should pass:

/**
 * Test PHPCS ignore comments between param docs.
 */
interface BreadcrumbBuilderInterface {

  /**
   * Whether this breadcrumb builder should be used to build the breadcrumb.
   *
   * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
   *   The current route match.
   * phpcs:ignore Drupal.Commenting.FunctionComment.ParamNameNoMatch
   * @param \Drupal\Core\Cache\CacheableMetadata $cacheable_metadata
   *   The cacheable metadata to add to if your check varies by or depends
   *   on something. Anything you specify here does not have to be repeated in
   *   the build() method as it will be merged in automatically.
   *
   * @return bool
   *   TRUE if this builder should be used or FALSE to let other builders
   *   decide.
   *
   * @todo Uncomment new method parameters before drupal:12.0.0, see
   *   https://www.drupal.org/project/drupal/issues/3459277.
   */
  public function applies(RouteMatchInterface $route_match /* , CacheableMetadata $cacheable_metadata */);

  /**
   * Builds the breadcrumb.
   *
   * There is no need to add any cacheable metadata that was already added in
   * applies() as that will be automatically added for you.
   *
   * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
   *   The current route match.
   *
   * @return \Drupal\Core\Breadcrumb\Breadcrumb
   *   A breadcrumb.
   */
  public function build(RouteMatchInterface $route_match);

}

Steps to reproduce

Run this example code against Coder.

Proposed resolution

Handle phpcs:ignore comments better.

Remaining tasks

PR.

API changes

none

📌 Task
Status

Active

Version

8.3

Component

Coder Sniffer

Created by

🇦🇹Austria klausi 🇦🇹 Vienna

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

Comments & Activities

Production build 0.71.5 2024