Skip to content

Commit db04cbd

Browse files
mmollxalopp
authored andcommitted
Pull in PSR12
1 parent 5801f54 commit db04cbd

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

MO4/ruleset.xml

+19
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@
1616
<exclude name="Symfony.Commenting.License"/>
1717
</rule>
1818

19+
<!-- Also include PSR12 -->
20+
<rule ref="PSR12">
21+
<!-- exclude sniffs that are disabled on purpose by this standard -->
22+
<exclude name="Generic.Files.LineLength.TooLong"/>
23+
<!-- not compatible with other rules we have later on -->
24+
<exclude name="PSR12.Classes.AnonClassDeclaration.SpaceAfterKeyword"/>
25+
<exclude name="PSR12.ControlStructures.ControlStructureSpacing"/>
26+
<exclude name="PSR12.Files.DeclareStatement"/>
27+
<exclude name="PSR12.Operators.OperatorSpacing"/>
28+
</rule>
29+
1930
<!-- Forbid strings in `"` unless necessary -->
2031
<rule ref="Squiz.Strings.DoubleQuoteUsage.NotRequired"/>
2132
<!-- There must be at least one space around operators -->
@@ -140,6 +151,14 @@
140151
</rule>
141152
<!-- Forbid useless alias for classes, constants and functions -->
142153
<rule ref="SlevomatCodingStandard.Namespaces.UselessAlias"/>
154+
<!-- Require empty newlines before and after uses -->
155+
<rule ref="SlevomatCodingStandard.Namespaces.UseSpacing">
156+
<properties>
157+
<property name="linesCountBeforeFirstUse" value="1"/>
158+
<property name="linesCountBetweenUseTypes" value="0"/>
159+
<property name="linesCountAfterLastUse" value="1"/>
160+
</properties>
161+
</rule>
143162
<!-- Require the usage of assignment operators, eg `+=`, `.=` when possible -->
144163
<rule ref="SlevomatCodingStandard.Operators.RequireCombinedAssignmentOperator"/>
145164
<!-- Report ++ and minus-minus operators not used standalone -->

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The MO4 Coding Standard is an extension of the [Symfony Coding Standard](http://
3030
* doc blocks of class properties must be multiline and have exactly one `@var` annotation
3131

3232
### MO4.Formatting.AlphabeticalUseStatements
33-
* `use` statements must be sorted lexicographically, grouped by empty lines. The order function can be configured.
33+
* `use` statements must be sorted lexicographically. The order function can be configured.
3434

3535
#### Configuration
3636
The `order` property of the `MO4.Formatting.AlphabeticalUseStatements` sniff defines

0 commit comments

Comments
 (0)