Following up on comments by @Tgr and @JānisElmeris:
https://github.com/php-fig/fig-standards/blob/master/proposed/phpdoc-tags.md#41-making-inheritance-explicit-using-the-inheritdoc-tag says that @inheritDoc is for entirely replacing the child documentation with its parent's documentation; while {@inheritDoc} is conversely for including the parent's documentation (specifically, the main description) at that position in the child documentation.
You should use one or the other in order that human readers can see that documentation is available.
I expect that the letter case for the D is irrelevant, and so the all-lower-case variants are equivalent.
Quoting the current version:
4.1 Making inheritance explicit using the @inheritDoc tag
Because inheritance is implicit it may happen that it is not necessary to include a PHPDoc with a "Structural Element". This can cause confusion as it is now ambiguous whether the PHPDoc was omitted on purpose or whether the author of the code had forgotten to add documentation.
In order to resolve this ambiguity the @inheritDoc tag can be used to indicate that this element will inherit its information from a super-element.
4.2 Using the {@inheritDoc} inline tag to augment a Description
Sometimes you want to inherit the Description of a super-element and add your own text with it to provide information specific to your "Structural Element". This MUST be done using the {@inheritDoc} inline tag.
The {@inheritDoc} inline tag will indicate that at that location the super-element's description MUST be injected or inferred.
Judging from the comments, the URL for this information has changed at least once, so for the sake of persistence the following is section 4 in its entirety:
4. Regarding Inheritance
A PHPDoc that is associated with a "Structural Element" that implements, extends or overrides a "Structural Element" has the ability to inherit parts of information from the PHPDoc associated with the "Structural Element" that is implemented, extended or overridden.
The PHPDoc for every type of "Structural Element" MUST inherit the following parts if that part is absent:
- Summary
- Description and
- A specific subset of Tags:
- @author
- @copyright
- @version
The PHPDoc for each type of "Structural Element" MUST also inherit a specialized subset of tags depending on which "Structural Element" is associated.
If a PHPDoc does not feature a part, such as Summary or Description, that is present in the PHPDoc of a super-element, then that part is always implicitly inherited. The following is a list of all elements whose DocBlocks are able to inherit information from a super-element's DocBlock:
- a Class' or Interface's DocBlock can inherit information from a Class or Interface which it extends.
- a Property's DocBlock can inherit information from a Property with the same name that is declared in a superclass.
- a Method's DocBlock can inherit information from a Method with the same name that is declared in a superclass.
- a Method's DocBlock can inherit information from a Method with the same name that is declared in an implemented interface in the current Class or that is implemented in a superclass.
For example:
Let's assume you have a method \SubClass::myMethod() and its class \SubClass extends the class \SuperClass. And in the class \SuperClass there is a method with the same name (e.g. \SuperClass::myMethod).
If the above applies then the DocBlock of \SubClass::myMethod() will inherit any of the parts mentioned above from the PHPDoc of \SuperClass::myMethod. So if the @version tag was not redefined then it is assumed that \SubClass::myMethod() will have the same @version tag.
Inheritance takes place from the root of a class hierarchy graph to its leafs. This means that anything inherited in the bottom of the tree MUST 'bubble' up to the top unless overridden.
4.1. Making inheritance explicit using the @inheritDoc tag
Because inheritance is implicit it may happen that it is not necessary to include a PHPDoc with a "Structural Element". This can cause confusion as it is now ambiguous whether the PHPDoc was omitted on purpose or whether the author of the code had forgotten to add documentation.
In order to resolve this ambiguity the @inheritDoc tag can be used to indicate that this element will inherit its information from a super-element.
Example:
/**
* This is a summary.
*/
class SuperClass
{
}
/**
* @inheritDoc
*/
class SubClass extends SuperClass
{
}
In the example above the SubClass' Summary can be considered equal to that of the SuperClass element, which is thus "This is a summary.".
4.2. Using the {@inheritDoc} inline tag to augment a Description
Sometimes you want to inherit the Description of a super-element and add your own text with it to provide information specific to your "Structural Element". This MUST be done using the {@inheritDoc} inline tag.
The {@inheritDoc} inline tag will indicate that at that location the super-element's description MUST be injected or inferred.
Example:
/**
* This is the Summary for this element.
*
* {@inheritDoc}
*
* In addition this description will contain more information that
* will provide a detailed piece of information specific to this
* element.
*/
In the example above it is indicated that the Description of this PHPDoc is a combination of the Description of the super-element, indicated by the {@inheritDoc} inline tag, and the subsequent body text.
4.3. Element-specific inherited parts
4.3.1. Class Or Interface
In addition to the inherited descriptions and tags as defined in this chapter's root, a class or interface MUST inherit the following tags:
4.3.2. Function Or Method
In addition to the inherited descriptions and tags as defined in this chapter's root, a function or method in a class or interface MUST inherit the following tags:
4.3.3. Constant Or Property
In addition to the inherited descriptions and tags as defined in this chapter's root, a constant or property in a class MUST inherit the following tags: