-
-
Notifications
You must be signed in to change notification settings - Fork 634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redundant documentation in interface+implementation, or errors #1724
Comments
With ping @waltertamboer |
I am struggling with the same problem. Since all methods should have a docblock, it would be nice to simply have an "@inherit" annotation that inherits the docblock of the parent. I'm not sure if this is considered in PSR-5? In PSR-5 there is a part about inheritance but it seems a bit too unclear to me. I'm not sure if |
I checked that for you. But I can't find anything in de code of phpdocumentor about the Good to know is that there is a difference in the implementation. Between summary and description. Summary is concidered to be a single line. So when you place
|
For PSR-5 we have had discussions with the maintainers of Doctrine on how to approach this issue. Historically Since phpDocumentor 1 came out Doctrine and Symfony have adopted the use of Like this:
With phpDocumentor 2 we have adopted that behaviour to prevent confusion with users that produced that style of documentation. When I wrote PSR-5 I had discussions with Ocramius if we could somehow 'rectify' the inconsistency of Tags are allowed to be used without a Summary and Description according to the PHPDoc syntax and |
With an interface defining a method and a class implementing it, both must have nearly identical doc blocks. If the implementation has no doc block on the method, or it's missing the summary or
@param
tags, phpDocumentor2 sees that as an error (in the CLI, with a nasty looking red background, and on the "Errors" report page).Errors notwithstanding, the doc block from the interface does show up in the generated documentation for the implementation, as it should. As far as I can see, there is no way to silence this type of error.
Is my understanding correct that I have to choose between maintaining two largely identical copies of a method doc block, or living with lots of error messages? When there are lots of non-critical warnings, they tend to get ignored, and any legitimate warning will probably go unnoticed.
The same basic question also applies to inherited properties and methods.
The text was updated successfully, but these errors were encountered: