Skip to content

Commit 67a3437

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

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

wiki/Customisable-Sniff-Properties.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ For more information about changing sniff behaviour by customising your ruleset,
3838
* [PSR2.ControlStructures.SwitchDeclaration](#psr2controlstructuresswitchdeclaration)
3939
* [PSR2.Methods.FunctionCallSignature](#psr2methodsfunctioncallsignature)
4040
* PSR12 Sniffs
41+
* [PSR12.Classes.AnonClassDeclaration](#psr12classesanonclassdeclaration)
42+
* [PSR12.ControlStructures.ControlStructureSpacing](#psr12controlstructurescontrolstructurespacing)
4143
* [PSR12.Namespaces.CompoundNamespaceDepth](#psr12namespacescompoundnamespacedepth)
4244
* [PSR12.Operators.OperatorSpacing](#psr12operatorsoperatorspacing)
4345
* Squiz Sniffs
@@ -881,6 +883,40 @@ See the [PEAR.Functions.FunctionCallSignature](#pearfunctionsfunctioncallsignatu
881883

882884
## PSR12 Sniffs
883885

886+
### PSR12.Classes.AnonClassDeclaration
887+
888+
Property Name | Type | Default | Available Since
889+
------------ | ---- | ------- | ---------------
890+
indent | int | 4 | 3.5.0
891+
892+
> Note: The `indent` property is inherited from the [PSR2.Classes.ClassDeclaration](#psr2classesclassdeclaration) sniff.
893+
894+
This sniff checks the indent of a list of implemented or extended class names that have been split over multiple lines, and the indent of variables passed to the constructor that have been split over multiple lines. By default, this sniff ensures that the class names and passed variables are indented 4 spaces, but you can change the size of the indent by setting the `indent` property.
895+
896+
```xml
897+
<rule ref="PSR12.Classes.AnonClassDeclaration">
898+
<properties>
899+
<property name="indent" value="2" />
900+
</properties>
901+
</rule>
902+
```
903+
904+
### PSR12.ControlStructures.ControlStructureSpacing
905+
906+
Property Name | Type | Default | Available Since
907+
------------ | ---- | ------- | ---------------
908+
indent | int | 4 | 3.5.0
909+
910+
One of the rules that this sniff enforces is the indent of each condition in a control structure when the conditions have been split over multiple lines. By default, this sniff ensures that the conditions are indented 4 spaces, but you can change the size of the indent by setting the `indent` property.
911+
912+
```xml
913+
<rule ref="PSR12.ControlStructures.ControlStructureSpacing">
914+
<properties>
915+
<property name="indent" value="2" />
916+
</properties>
917+
</rule>
918+
```
919+
884920
### PSR12.Namespaces.CompoundNamespaceDepth
885921

886922
Property Name | Type | Default | Available Since

0 commit comments

Comments
 (0)