Skip to content

Commit 2e2183c

Browse files
gsherwoodjrfnl
authored andcommitted
Updated Customisable Sniff Properties (markdown)
1 parent e613833 commit 2e2183c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

wiki/Customisable-Sniff-Properties.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ For more information about changing sniff behaviour by customising your ruleset,
4040
* [PSR2.Methods.FunctionCallSignature](#psr2methodsfunctioncallsignature)
4141
* PSR12 Sniffs
4242
* [PSR12.Classes.AnonClassDeclaration](#psr12classesanonclassdeclaration)
43+
* [PSR12.ControlStructures.BooleanOperatorPlacement](#psr12controlstructuresbooleanoperatorplacement)
4344
* [PSR12.ControlStructures.ControlStructureSpacing](#psr12controlstructurescontrolstructurespacing)
4445
* [PSR12.Namespaces.CompoundNamespaceDepth](#psr12namespacescompoundnamespacedepth)
4546
* [PSR12.Operators.OperatorSpacing](#psr12operatorsoperatorspacing)
@@ -953,6 +954,22 @@ This sniff checks the indent of a list of implemented or extended class names th
953954
</rule>
954955
```
955956

957+
### PSR12.ControlStructures.BooleanOperatorPlacement
958+
959+
Property Name | Type | Default | Available Since
960+
------------ | ---- | ------- | ---------------
961+
allowOnly | bool | null | 3.5.4
962+
963+
This sniff ensures that boolean operators inside control structure conditions either all appear at the beginning of a line, or the end of a line, but not a mix of both. If you prefer to explicitly define where boolean operators should appear, you can set the `allowOnly` property to either `first` or `last` to ensure that boolean operators are always the first or last content of a line.
964+
965+
```xml
966+
<rule ref="PSR12.ControlStructures.BooleanOperatorPlacement">
967+
<properties>
968+
<property name="allowOnly" value="first" />
969+
</properties>
970+
</rule>
971+
```
972+
956973
### PSR12.ControlStructures.ControlStructureSpacing
957974

958975
Property Name | Type | Default | Available Since

0 commit comments

Comments
 (0)