-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Added PSR-2 documentation XML files #3832
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blue32a Thank you for your willingness to contribute.
I have reviewed these XML docs, checked for common mistakes and tested them in CLI.
Findings:
PSR2.Files.ClosingTag
: ✅PSR2.Methods.FunctionClosingBrace
: I'd recommend some minor tweaks to the code sample descriptions to make it more obvious what the sniff is looking for.PSR2.Methods.FunctionCallSignature
:- The code samples used aren't function calls, while the sniff is about function calls.
- I'd recommend some tweaks to the code sample descriptions to make it more obvious what the sniff is looking for.
- There are numerous additional checks the sniff does, but which are not mentioned in the docs.
This is not a blocker, as those can be added at a later time, but it should be noted all the same.
Extra checks currently not mentioned:- First argument in a multi-line function call must be on a new line.
- Only one argument per line in a multi-line function call.
- No blank lines in a multi-line function call.
src/Standards/PSR2/Docs/Methods/FunctionClosingBraceStandard.xml
Outdated
Show resolved
Hide resolved
src/Standards/PSR2/Docs/Methods/FunctionClosingBraceStandard.xml
Outdated
Show resolved
Hide resolved
src/Standards/PSR2/Docs/Methods/FunctionCallSignatureStandard.xml
Outdated
Show resolved
Hide resolved
src/Standards/PSR2/Docs/Methods/FunctionCallSignatureStandard.xml
Outdated
Show resolved
Hide resolved
src/Standards/PSR2/Docs/Methods/FunctionCallSignatureStandard.xml
Outdated
Show resolved
Hide resolved
src/Standards/PSR2/Docs/Methods/FunctionCallSignatureStandard.xml
Outdated
Show resolved
Hide resolved
src/Standards/PSR2/Docs/Methods/FunctionCallSignatureStandard.xml
Outdated
Show resolved
Hide resolved
foo<em> </em>(<em> </em>$bar, $baz<em> </em>) { | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
foo<em> </em>(<em> </em>$bar, $baz<em> </em>) { | |
} | |
foo<em> </em>(<em> </em>$bar, $baz<em> </em>)<em> </em>; |
src/Standards/PSR2/Docs/Methods/FunctionCallSignatureStandard.xml
Outdated
Show resolved
Hide resolved
P.S.: The new files should also be added to the |
@jrfnl Thank you for your review. I have updated the PR with your findings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blue32a Hiya, thanks for making those updates! The docs all look good to me now.
Only thing left to do is to update the package.xml
file - as noted above, the three new files need to be added to the file list in the package.xml
file.
I had missed it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had missed it. Three new documents have been added to
package.xml
.
@blue32a Thank you! All looks good to me now ✅
Documentation for the following PSR2 sniffs: * `PSR2.Files.ClosingTag` * `PSR2.Methods.FunctionCallSignature` * `PSR2.Methods.FunctionClosingBrace`
FYI: this fix is included in today's PHP_CodeSniffer 3.8.0 release. As per #3932, development on PHP_CodeSniffer will continue in the PHPCSStandards/PHP_CodeSniffer repository. If you want to stay informed, you may want to start "watching" that repo (or watching releases from that repo). |
Thank you for providing a great tool.
Description
I was looking into sniffs to create a coding standard for my project and it took me a long time to get to the
generator
.I found some missing in the documentation and am submitting this PR.
Hope that helps.
Suggested changelog entry
PSR-2
documentation XML files.Types of changes
PR checklist
package.xml
file.