[10.0.x and 9.5.x backports] Don't allow {@inheritDoc} annotation in PHPDocBlocks

Created on 18 December 2022, almost 2 years ago
Updated 20 January 2023, almost 2 years ago

Problem/Motivation

If a class has a method that is overriding a method from a parent class/interface, and the documentation is identical, use this short form for the documentation:

/**
 * {@inheritdoc}
 */
public function …

( https://www.drupal.org/docs/develop/standards/php/api-documentation-and-... , 2nd bullet-point)

(At least) PHPStorm out-of-the-box comes up with {@inheritDoc} (notice the capital D) as the default autocomplete option.

Let's fix the occurrences that are currently already in the Core codebase and use a Slevomat Rule to make sure no new occurrences creep in.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

The SlevomatCodingStandard.Commenting.ForbiddenAnnotations and SlevomatCodingStandard.Commenting.ForbiddenComments rules have been enabled to standardize the format of {@inheritdoc} for API docblocks.

📌 Task
Status

Fixed

Version

9.5

Component
Other 

Last updated about 1 hour ago

Created by

🇳🇱Netherlands spokje

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Status changed to RTBC almost 2 years ago
  • Status changed to Fixed almost 2 years ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024