-
Notifications
You must be signed in to change notification settings - Fork 102
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
The ruleset force to add PHPDoc blocks for all methods #120
Comments
I agree. Furthermore, the rules should also sniff useless PHPdoc class Test {
/**
* @param string $a
* @param int $b with description.
*
* @return int
*/
public function test(string $a, int $b): int
{
return 42;
}
} Only |
Maybe including this rule will be enough: https://github.com/slevomat/coding-standard#slevomatcodingstandardtypehintstypehintdeclaration- |
PHPdoc |
The rule I suggested removes the phpdoc only if useless. It wont touch anything if the PHP 7 typing is not used. |
Hey! No plan for this rules ? |
PHP-CS-Fixer released a new version which configure the Symfony rule for removing PHPDocs when not necessary. At the moment we can't use both PHP-CS-Fixer and this project because the first one remove PHPDocs and the second is requiring them. |
you can add the following to your php-cs-fixer config 'no_superfluous_phpdoc_tags' => false, symfony coding standard still states:
https://symfony.com/doc/current/contributing/code/standards.html#documentation |
additionally you should be able to add the following snippet to your <rule ref="Symfony.Commenting.FunctionComment.MissingParamTag">
<severity>0</severity>
</rule> |
ah ic, you want the parameter requirement to be dropped raqther than the docblock requirement. |
What I would like is to use the php-cs-fixer |
though i understand your sentiment, my problem with this is that it's not part of the coding standard / explicitly stated. so i'd vote for removal of the paramter annotation as that's not explicitly stated as well, and just require a docblock regardless of it's contents, but would say that any additional / custom requirements for parameter annotations should be part of your private sniffs / config. @djoos what are your thoughts on this? |
Please see #183 for a start to use Slevomat sniffs instead of homegrown ones and comment there. Pulling in more sniffs would be super easy then. |
The Symfony coding strandard documentation states:
For example the inherited methods should not contain any PHPDoc comments, except if we want to add additional details.
The text was updated successfully, but these errors were encountered: