Skip to content

Commit 7cc2f64

Browse files
gsherwoodjrfnl
authored andcommitted
Updated Customisable Sniff Properties (markdown)
1 parent 67a3437 commit 7cc2f64

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

wiki/Customisable-Sniff-Properties.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ For more information about changing sniff behaviour by customising your ruleset,
2323
* [Generic.Strings.UnnecessaryStringConcat](#genericstringsunnecessarystringconcat)
2424
* [Generic.WhiteSpace.ArbitraryParenthesesSpacing](#genericwhitespacearbitraryparenthesesspacing)
2525
* [Generic.WhiteSpace.ScopeIndent](#genericwhitespacescopeindent)
26+
* [Generic.WhiteSpace.SpreadOperatorSpacingAfter](#genericwhitespacespreadoperatorspacingafter)
2627
* PEAR Sniffs
2728
* [PEAR.ControlStructures.ControlSignature](#pearcontrolstructurescontrolsignature)
2829
* [PEAR.ControlStructures.MultiLineCondition](#pearcontrolstructuresmultilinecondition)
@@ -591,6 +592,33 @@ Setting the `ignoreIndentationTokens` property provides the sniff with a list of
591592
</rule>
592593
```
593594

595+
### Generic.WhiteSpace.SpreadOperatorSpacingAfter
596+
597+
Property Name | Type | Default | Available Since
598+
-------------- | ---- | ------- | ---------------
599+
spacing | int | 0 | 3.5.0
600+
ignoreNewlines | bool | false | 3.5.0
601+
602+
This sniff checks the spacing after a `...` operator. By default, the sniff ensures there is no space after the operator, but you can enforce a fixed number of spaces by setting the `spacing` property.
603+
604+
```xml
605+
<rule ref="Generic.WhiteSpace.SpreadOperatorSpacingAfter">
606+
<properties>
607+
<property name="spacing" value="1" />
608+
</properties>
609+
</rule>
610+
```
611+
612+
If you want to allow a newline after the operator, you can set the `ignoreNewlines` property to `true`.
613+
614+
```xml
615+
<rule ref="Generic.WhiteSpace.SpreadOperatorSpacingAfter">
616+
<properties>
617+
<property name="ignoreNewlines" value="true" />
618+
</properties>
619+
</rule>
620+
```
621+
594622

595623

596624

0 commit comments

Comments
 (0)