Skip to content

Commit 9d1db93

Browse files
authored
Add PSR12 and namespaces rules (#41)
- Add PSR12 rule - Add rule to force usage of referenced name (Everything must be declared in uses) - Add rule to force alphabetical sort of namespaces uses
1 parent 3e7d01a commit 9d1db93

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

phpcs/ruleset.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,11 @@
5959
<rule ref="MySource.PHP.GetRequestData"/>
6060
<rule ref="PEAR.Commenting.InlineComment"/>
6161
<rule ref="PEAR.ControlStructures.ControlSignature"/>
62+
<rule ref="PEAR.NamingConventions.ValidClassName"/>
6263
<rule ref="PSR1.Classes.ClassDeclaration"/>
6364
<rule ref="PSR1.Files.SideEffects"/>
65+
<rule ref="PSR2.Classes.ClassDeclaration"/>
66+
<rule ref="PSR12"/>
6467
<rule ref="Squiz.ControlStructures.LowercaseDeclaration"/>
6568
<rule ref="Squiz.PHP.DisallowSizeFunctionsInLoops"/>
6669
<rule ref="Squiz.PHP.Eval"/>
@@ -119,11 +122,10 @@
119122
<exclude name="Squiz.Arrays.ArrayDeclaration.SingleLineNotAllowed"/>
120123
</rule>
121124

122-
<rule ref="PEAR.NamingConventions.ValidClassName"/>
123-
<rule ref="PSR2.Classes.ClassDeclaration"/>
124-
125125
<config name="installed_paths" value="../../slevomat/coding-standard"/>
126126
<rule ref="SlevomatCodingStandard.Commenting.UselessFunctionDocComment.UselessDocComment"/>
127+
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses"/>
128+
<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly"/>
127129
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses"/>
128130
<rule ref="SlevomatCodingStandard.Namespaces.UselessAlias"/>
129131
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.UselessAnnotation"/>

0 commit comments

Comments
 (0)