Skip to content

Commit 4c015a9

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

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

wiki/Customisable-Sniff-Properties.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,6 +1141,7 @@ Property Name | Type | Default | Available Since
11411141
------------------------- | ---- | ------- | ---------------
11421142
requiredSpacesAfterOpen | int | 0 | 1.5.2
11431143
requiredSpacesBeforeClose | int | 0 | 1.5.2
1144+
ignoreNewlines | bool | false | 3.5.4
11441145

11451146
This sniff checks that `for` structures have the correct padding inside their bracketed statement. By default, the sniff ensures there are zero spaces following the opening bracket, and zero spaces preceding the closing bracket, as shown in the following code snippet:
11461147

@@ -1169,6 +1170,16 @@ If you prefer to write your code like this, you can set the `requiredSpacesAfter
11691170
</rule>
11701171
```
11711172

1173+
Sometimes long control structures are broken over multiple lines to work within a maximum line length, but this sniff will generate an error for these cases by default. Setting the `ignoreNewlines` property to `true` will allow newline characters before, after, and between each of the three bracketed statements.
1174+
1175+
```xml
1176+
<rule ref="Squiz.ControlStructures.ForLoopDeclaration">
1177+
<properties>
1178+
<property name="ignoreNewlines" value="true" />
1179+
</properties>
1180+
</rule>
1181+
```
1182+
11721183
### Squiz.ControlStructures.SwitchDeclaration
11731184

11741185
Property Name | Type | Default | Available Since

0 commit comments

Comments
 (0)