PHP_CodeSniffer icon indicating copy to clipboard operation
PHP_CodeSniffer copied to clipboard

fix: skip processing of Squiz.Commenting.FunctionComment for @inheritDoc

Open PavelSavushkinMix opened this issue 4 years ago • 4 comments

It's supported to use {@inheritDoc}. Add support of @inheritDoc (w/o brackets). Original PR number - #3051

Closes #2770

PavelSavushkinMix avatar Jan 17 '22 15:01 PavelSavushkinMix

For context:

phpDocumentor states that inheritance is implicit when there is no docblock, so the tag should only be used for partial inheritance via an inline tag {@inheritDoc}

Refs:

  • https://docs.phpdoc.org/3.0/guide/guides/inheritance.html
  • https://docs.phpdoc.org/3.0/guide/references/phpdoc/inline-tags/index.html#inline-tag-reference

The draft PSR-19 reference does allow for the tag without brackets, but then again, is still subject to change as still in draft.

Refs:

  • https://github.com/php-fig/fig-standards/blob/master/proposed/phpdoc-tags.md#41-making-inheritance-explicit-using-the-inheritdoc-tag
  • https://github.com/php-fig/fig-standards/blob/master/proposed/phpdoc-tags.md#42-using-the-inheritdoc-inline-tag-to-augment-a-description

jrfnl avatar Jan 17 '22 16:01 jrfnl

This PR is missing tests. Please add some.

Thanks for the fast reply. Added tests.

PavelSavushkinMix avatar Jan 17 '22 16:01 PavelSavushkinMix

So, @jrfnl, would you like me to close the PR due to provided references?

Or just keep it till the PSR-19 is released?

PavelSavushkinMix avatar Jan 17 '22 16:01 PavelSavushkinMix

So, @jrfnl, would you like me to close the PR due to provided references?

Or just keep it till the PSR-19 is released?

Not really up to me. I added the references so the maintainer can make an informed decision.

I'd say, leave it open for now and wait for a response from someone with commit rights. Be aware that it may be a while before you will get such a response.,

jrfnl avatar Jan 17 '22 17:01 jrfnl