@inheritDoc should be exempt from documentation checking, since presumably we'll check whatever it is inheriting from.
Noted by @Jdforrester-WMF and @Anomie
@inheritDoc should be exempt from documentation checking, since presumably we'll check whatever it is inheriting from.
Noted by @Jdforrester-WMF and @Anomie
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Don't require return/throws/param for doc blocks with @inheritDoc | mediawiki/tools/codesniffer | master | +24 -1 |
Also consider whether requiring /** @inheritDoc */ is even necessary on inherited methods.
Change 353623 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/tools/codesniffer@master] Don't require return/throws/param for doc blocks with @inheritDoc
I read through https://www.phpdoc.org/docs/latest/guides/inheritance.html#the-inheritdoc-tag, and one of the points it made was that the @inheritDoc tag can be used to mark something as explicitly documented, versus something that someone forgot to document, and it just happens to inherit so it was skipped.
Also in MW-CS we don't keep track of inheritance stuff, so it wouldn't be technically possible right now.
Change 353623 merged by jenkins-bot:
[mediawiki/tools/codesniffer@master] Don't require return/throws/param for doc blocks with @inheritDoc
Note that while the PSR-5 draft has @inheritDoc, most other projects and tools use @inheritdoc, in all lowercase. (E.g. phpDocumentor, Drupal, PhpStorm.) At a minumum, there should be a specific warning in that case, instead of just ignoring the lowercase variant and warning about missing documentation.