You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some sniffs from the "Squiz" collection are used in doctrine/coding-standard. The standard does not enforce a phpDoc block for each symbol and, furthermore, forbids the usage of useless doc blocks.
If a phpDoc template (example) is followed by a method without a docblock, then the "Squiz.Commenting.FunctionComment" sniff mistakenly attributes the closing template block to the method and marks it as invalid:
phpcs --standard=Squiz Test.inc -s
FILE: /home/morozov/Projects/dbal/Test.inc
------------------------------------------------------------------------------------------------
FOUND 14 ERRORS AFFECTING 7 LINES
------------------------------------------------------------------------------------------------
...
10 | ERROR | [ ] There must be no blank lines after the function comment
| | (Squiz.Commenting.FunctionComment.SpacingAfter)
...
------------------------------------------------------------------------------------------------
The text was updated successfully, but these errors were encountered:
Docblock templates are completely unsupported by the Squiz coding standard as they are never used within Squiz code. Adding proper support would be more than just ignoring the closing comment here, and it would certainly generate a lot more errors that you wont want. The Squiz standard tries to enforce a docblock for everything, so any changes that move it away from that direction would not be considered.
What you really need is a generic collection of docblock sniffs that are flexible enough to implement your own rules, but it's not something that is being worked on.
What you really need is a generic collection of docblock sniffs that are flexible enough to implement your own rules, but it's not something that is being worked on.
Agree. I believe that this is the idea behind slevomat/coding-standard. Instead of reusing code from the "Squiz" standard, maybe there's a better way to implement the same rules.
What you really need is a generic collection of docblock sniffs that are flexible enough to implement your own rules, but it's not something that is being worked on.
Actually, this is being worked on, just not yet public ;-)
Some sniffs from the "Squiz" collection are used in doctrine/coding-standard. The standard does not enforce a phpDoc block for each symbol and, furthermore, forbids the usage of useless doc blocks.
Consider the code example:
If a phpDoc template (example) is followed by a method without a docblock, then the "Squiz.Commenting.FunctionComment" sniff mistakenly attributes the closing template block to the method and marks it as invalid:
The text was updated successfully, but these errors were encountered: