-
-
Notifications
You must be signed in to change notification settings - Fork 468
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
WordPress DocBlock: inheritdoc should be supported #1429
Comments
+1. Love to see this implemented, since it reduces a lot of comments when the plugin uses many inheritance. |
We run into this as well. We got a lot of warnings about missing short descriptions where we're using |
Unfortunately that's not reliably sniffable. PHPCS scans files in an undetermined order and possibly in parallel when parallel scanning is enabled. To be able to make exceptions for specific methods declared in interfaces we'd need to know in advance which methods are declared in which interface, as Unfortunately we don't have access to that information at the start of the scan. Allowing just any method in a class which |
I guess you are mixing concepts here. You could write this on a method class myClass implements theValueOfX {
/**
* Something that doesn't represent documentation.
*/
public function getTheValueOfX() { ... }
} That PHP CS will pass without any issue. Still is missing documentation. You're mixing what the writer writes and what a functionality does. Using |
@killua99 Whether something is good or bad documentation is a whole other matter and most definitely outside of the scope of WPCS.
It is when the method isn't inherited... |
But, who is gonna use it, if the method isn't inherited? I mean, the word is self describing inherit Documentation, from where is gonna inherit if is not an inherited method? That was my point perhaps I didn't explain me well. You can't control what the code writer writes. If he place a wrong DocBlock on a method then how are you gonna control it anyway? Is the same as using this |
@killua99 I'm not saying using All I'm saying is that within the constraints of using static analysis it is not easily possible to make an exception for it in a reliable manner. |
Perhaps this is too old and not relevant. Feel free to close this issue |
The DocBlock for decorators or classes that use interfaces for document a function normally is use;
The text was updated successfully, but these errors were encountered: