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

[Documentation] PSR12 - Boolean Operator Placement #181

Conversation

dingo-d
Copy link
Contributor

@dingo-d dingo-d commented Dec 23, 2023

The PR contains the documentation for the PSR12/ControlStructures/BooleanOperatorPlacement sniff.

Description

This PR will add the documentation for the above-mentioned sniff, according to the official standard definitions.

Suggested changelog entry

Add documentation for the PSR12 BooleanOperatorPlacement sniff

Related issues/external references

Part of #148

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
    • This change is only breaking for integrators, not for external standards or end-users.
  • Documentation improvement

PR checklist

  • I have checked there is no other PR open for the same change.
  • I have read the Contribution Guidelines.
  • I grant the project the right to include and distribute the code under the BSD-3-Clause license (and I have the right to grant these rights).
  • I have added tests to cover my changes.
  • I have verified that the code complies with the projects coding standards.
  • [Required for new sniffs] I have added XML documentation for the sniff.

Copy link
Member

@jrfnl jrfnl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR @dingo-d !

I've left a few suggestions inline which are optional.

However, the remark about the main description and the typo should definitely be addressed.

@jrfnl
Copy link
Member

jrfnl commented Jan 5, 2024

P.S.: Would you mind rebasing the PR before you continue work on it ? That should allow to get a passing build.

@dingo-d
Copy link
Contributor Author

dingo-d commented Jan 5, 2024

@jrfnl Before I rebase can you just check the change I made to the standard definition?

@jrfnl
Copy link
Member

jrfnl commented Jan 5, 2024

@jrfnl Before I rebase can you just check the change I made to the standard definition?

I'm fine with it as it is now.

For readability you could consider restructuring it a little like below, but that's up to you. Either way is fine by me.

Boolean operators between conditions in control structures must always be at the beginning or at the end of the line, not a mix of both.

This rule applies to if/else conditions, while loops and switch/match statements.

Aside from the "Invalid" description for the second code block, this is now good to go as far as I'm concerned.

@jrfnl jrfnl added this to the 3.x Next milestone Jan 5, 2024
Co-authored-by: Juliette <663378+jrfnl@users.noreply.github.com>
@dingo-d dingo-d force-pushed the documentation/PSR12-control-structures-boolean-operator-placement branch from 3771116 to 787fb83 Compare January 6, 2024 09:14
Copy link
Member

@jrfnl jrfnl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again @dingo-d ! LGTM!

@jrfnl jrfnl merged commit 2ab648b into PHPCSStandards:master Jan 6, 2024
38 checks passed
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.

3 participants