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

feat: Add operator linebreak to psr12 #7868

Closed

Conversation

VincentLanglet
Copy link
Contributor

Hi @Wirone

The rule is:
"Operators - when multiline - must always be at the beginning or at the end of the line."
cf https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/v3.49.0/doc/rules/operator/operator_linebreak.rst

Which comply with
"Boolean operators between conditions MUST always be at the beginning or at the end of the line, not a mix of both."
from https://www.php-fig.org/psr/psr-12/#51-if-elseif-else

@VincentLanglet VincentLanglet changed the title Add operator linebreak to psr12 feat: Add operator linebreak to psr12 Mar 8, 2024
@coveralls
Copy link

Coverage Status

coverage: 96.029%. remained the same
when pulling 16452d1 on VincentLanglet:onlyBoolean
into 438d5ea on PHP-CS-Fixer:master.

Copy link
Member

@keradus keradus left a comment

Choose a reason for hiding this comment

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

our fixer enforces that operator is always at beginning or always at end.

PSR expects that there is no mix, but doesn't enforce which variant to use

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants