slevomat / coding-standard

Slevomat Coding Standard for PHP_CodeSniffer provides many useful sniffs
MIT License
1.39k stars 171 forks source link

TypeHintDeclarationSniff: support for @inheritdoc #166

Closed asprega closed 7 years ago

asprega commented 7 years ago

Since this sniff does not support @inheritdoc for looking up @param and @return annotations in superclasses, when I extend framework classes I am forced to copy/paste annotations from there to my classes, or the sniff will report errors. Good examples might be Symfony forms or Doctrine types. Is there any intention to support this annotation, or does it pose significant issues/overhead?

kukulich commented 7 years ago

@asprega PHPCS doesn't know anything about parent classes. Each class is checked separately. I can only ignore methods with @inheritdoc. Would you be ok with this solution?

asprega commented 7 years ago

Thanks for the quick reply! Yes, that would work great for me.

kukulich commented 7 years ago

Fixed in https://github.com/slevomat/coding-standard/commit/727678c634864ff609157c6e6586e5c746fd3520.

Fuco1 commented 7 years ago

I was just about to submit this same issue. I think simply ignoring the method is an OK solution as the parent file would eventually be checked separately and the types will be specified there.

Thanks for fixing this!

github-actions[bot] commented 4 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.