Skip to content
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

CS: improve control structure layout/consistency #650

Merged
merged 2 commits into from
Dec 7, 2021

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Nov 27, 2021

As previously discussed in one of our calls.

CS: normalize control structures

Previously this codebase mostly placed the else (or other follow-on keyword in a multi-part control structure) on a new line, except this was not enforced leading to inconsistency across the codebase.

By removing the exclusion from the PHPCS ruleset, we now enforce the follow-on keyword in a multi-part control structure to be on the same line as the closing brace of the preceding control structure.

This is in line with both WPCS as well as PSR-12.

CS: improve code readability

... by enforcing a blank line after control structures.

Previously this codebase mostly placed the `else` (or other follow-on keyword in a multi-part control structure) on a new line, except this was not enforced leading to inconsistency across the codebase.

By removing the exclusion from the PHPCS ruleset, we now enforce the follow-on keyword in a multi-part control structure to be on the same line as the closing brace of the preceding control structure.

This is in line with both WPCS as well as PSR-12.
... by enforcing a blank line after control structures.
@jrfnl jrfnl added this to the 2.x Next milestone Nov 27, 2021
@schlessera schlessera merged commit 44cfa82 into develop Dec 7, 2021
@schlessera schlessera deleted the feature/cs-consistent-control-structures branch December 7, 2021 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants