Skip to content

Commit 37bcab6

Browse files
committed
Ruleset: configure PSR12.ControlStructures.BooleanOperatorPlacement sniff
Set the `allowOnly` property for the `PSR12.ControlStructures.BooleanOperatorPlacement` sniff to "first" to enforce boolean operators to always be at the start of a line, not the end. This property is available since PHPCS 3.5.4.
1 parent aedb280 commit 37bcab6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

PHPCSDev/ruleset.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@
8181
####################################################################
8282
-->
8383

84+
<!-- PSR12 doesn't enforce consistency in where boolean operators are placed. We do. -->
85+
<rule ref="PSR12.ControlStructures.BooleanOperatorPlacement">
86+
<properties>
87+
<property name="allowOnly" value="first"/>
88+
</properties>
89+
</rule>
90+
8491
<!-- PSR12 appears to ignore blank lines for superfluous whitespace and in several other places. Let's fix that. -->
8592
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
8693
<properties>

0 commit comments

Comments
 (0)