Skip to content

[Documentation] PSR12 - Boolean Operator Placement - #181

Merged
jrfnl merged 1 commit into
PHPCSStandards:masterfrom
dingo-d:documentation/PSR12-control-structures-boolean-operator-placement
Jan 6, 2024
Merged

jrfnl merged 1 commit into
PHPCSStandards:masterfrom
dingo-d:documentation/PSR12-control-structures-boolean-operator-placement

Conversation

@dingo-d

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

Copy link
Copy Markdown
Contributor

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.

@jrfnl jrfnl left a comment

Copy link
Copy Markdown
Member

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

jrfnl commented Jan 5, 2024

Copy link
Copy Markdown
Member

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

@dingo-d

dingo-d commented Jan 5, 2024

Copy link
Copy Markdown
Contributor Author

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

@jrfnl

jrfnl commented Jan 5, 2024 •

Copy link
Copy Markdown
Member

@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
@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

@jrfnl jrfnl left a comment

Copy link
Copy Markdown
Member

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
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