Repository navigation
Generic/EmptyPHPStatement: add XML documentation - #166
Conversation
60eeaca to
caf08e7
Compare
|
One of the GitHub actions failed when trying to download PHPCS phar and it seems I don't have permission to run it again: https://github.com/PHPCSStandards/PHP_CodeSniffer/actions/runs/7275269656/job/19822876012?pr=166. I imagine it was due to a temporary problem that is not related to the changes in this PR. |
This is a known issue and shouldn't happen anymore (for now) - see #204 |
There was a problem hiding this comment.
Thanks for this PR @rodrigoprimo .
I considered adding another
<standard>block to the beginning of the file summarizing what this sniff does.
...
It does duplicate the content of the other<standard>blocks, but it provides a nice summary at the top of the documentation.
...
Any thoughts on this?
I'm not against adding a summary block at the start when it has value, but I don't see it having value when it just repeats what's already in the other blocks.
So:
❌ Empty PHP tags and superfluous semi-colons are not allowed.
✔️ Empty PHP statements are not allowed (=> the empty PHP tag sets and superfluous semi-colons are symptoms, empty PHP statements is the actual problem the sniff addresses.)
Thanks for your input. In the end, I decided not to include a summary description at the top. I'm not super sure about and after trying it now it felt a little bit weird and repetitive since there is no clear separation between summary description and the description for the first This PR is ready for a final review. |
* Generic/EmptyPHPStatement: add documentation * Fix one of the invalid examples in EmptyPHPStatementStandard.xml
Description
This PR adds documentation for the Generic/EmptyPHPStatement sniff.
I added one
<standard>block per warning generated by this sniff. I considered adding another<standard>block to the beginning of the file summarizing what this sniff does. Something like:It does duplicate the content of the other
<standard>blocks, but it provides a nice summary at the top of the documentation. Without the summary, there is a chance that someone skimming through the documentation might assume that this sniff is only about empty PHP tags and doesn't cover superfluous semi-colons.I ended up not including the "summary"
<standard>most of the other sniffs that contain multiple<standard>blocks don't contain a summary at the top. The only exception that I found is ArrayDeclarationStandard.xml. Any thoughts on this?Suggested changelog entry
Add documentation for the Generic.CodeAnalysis.EmptyPHPStatement sniff
Related issues/external references
Part of #148
Types of changes
PR checklist