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

Created on 18 December 2022, over 1 year ago
Updated 20 January 2023, over 1 year 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 1 minute 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 over 1 year ago
  • Status changed to Fixed over 1 year ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024