Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[Documentation] PSR12 - Control Structure Spacing #182
[Documentation] PSR12 - Control Structure Spacing #182
Changes from 17 commits
5a0186f
f4fabf1
62cd376
baf28e9
5961ed8
e2f79ab
4ac58b1
c14c5dd
8041c8b
a57752b
0b63cb0
1bf2c27
f6ec02b
383618b
cdeef4d
c62e10f
a1795c1
b38b4b7
f593a53
6a22d05
77366bb
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Should the "no space after the keyword" rule get its own code sample ? Or could this be included in this invalid code sample ?
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.
Technically, this sniff doesn't check for the space after the keyword. This is covered by the
Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword
sniff, so I'm not sure if we should include it in the documentation for this sniff.I'm all for removing squiz rules from the PSR12 ruleset, and just modifying the
ControlStructuresSpacing
sniff to include all the checks as in the PSR-12 documentation for control structures, but I think that would be something for PHPCS v4.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.
You are 100% correct! I thought this sniff was checking that too, but you are right, it does not. The updated standards description from commit a1795c1 confused me as that _does_mention the space after the control structure keyword.
In other words: No, there should not be a code sample for space after keyword, but the first
<standard>
block will need to be updated to remove the mention of the spacing after the keyword.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.
And this bit ", and one space between the closing parenthesis and the opening brace" will also need to be removed as that is also not checked via this sniff.
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.
Yes, you're right about these. Will fix them now 👍🏼