Hello,
Are there rules available to enforce PHPdocs for class methods?
Hello,
Are there rules available to enforce PHPdocs for class methods?
Hello,
Thanks for your patience.
We don’t have such a rule to enforce comments on class methods for PHP. We have it for Java (S1176) and it is not activated by default. This rule was not implemented in any other language.
I can understand that as a library maintainer, for example, you want to enforce all methods to have PHPDocs because this content will be used to generate a website that will be, at the end, the end-user documentation. As an end-user developer writing the code that will be delivered in prod, it’s more debatable to have to comment on all class methods. I’m more in favor of only commenting when it’s required: ie when the code is not self-explanatory.
Alex