Skip to content

Commit ff12d04

Browse files
committed
Update sniffer rules
1 parent 92317fe commit ff12d04

1 file changed

Lines changed: 53 additions & 1 deletion

File tree

phpcs-simplesamlphp.xml

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0"?>
22
<ruleset name="SimpleSAMLphp">
3-
43
<!-- Only allow shorthand array syntax -->
54
<rule ref="Generic.Arrays.DisallowLongArraySyntax" />
65

@@ -10,8 +9,17 @@
109
<!-- Do not allow unnecessary spaces inside arbitrary parentheses -->
1110
<rule ref="Generic.WhiteSpace.ArbitraryParenthesesSpacing" />
1211

12+
<!-- Complain about unresolved merge conflicts -->
13+
<rule ref="Generic.VersionControl.GitMergeConflict" />
14+
1315
<config name="installed_paths" value="vendor/slevomat/coding-standard"/>
1416

17+
<!-- Use fully qualified class names in annotations and PHPdoc -->
18+
<rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation" />
19+
20+
<!-- Do not allow any grouped use-statements to exist -->
21+
<rule ref="SlevomatCodingStandard.Namespaces.DisallowGroupUse" />
22+
1523
<!-- Do not allow any unused use-statements to exist -->
1624
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses" />
1725

@@ -24,4 +32,48 @@
2432
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInClosureUse" />
2533
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInDeclaration" />
2634

35+
<!-- Enforce the use of typed constants -->
36+
<rule ref="SlevomatCodingStandard.TypeHints.ClassConstantTypeHint" />
37+
38+
<!-- Require one blank line between different types of use-statements -->
39+
<rule ref="SlevomatCodingStandard.Namespaces.UseSpacing">
40+
<properties>
41+
<property name="linesCountBetweenUseTypes" value="1" />
42+
</properties>
43+
</rule>
44+
45+
<!-- Require two blank lines between class members -->
46+
<rule ref="SlevomatCodingStandard.Classes.ClassMemberSpacing">
47+
<properties>
48+
<property name="linesCountBetweenMembers" value="2" />
49+
</properties>
50+
</rule>
51+
52+
<!-- Require one blank line between constant declarations -->
53+
<rule ref="SlevomatCodingStandard.Classes.ConstantSpacing">
54+
<properties>
55+
<property name="minLinesCountBeforeWithComment" value="1" />
56+
<property name="maxLinesCountBeforeWithComment" value="1" />
57+
<property name="minLinesCountBeforeWithoutComment" value="1" />
58+
<property name="maxLinesCountBeforeWithoutComment" value="1" />
59+
</properties>
60+
</rule>
61+
62+
<!-- Require one blank line between property definitions -->
63+
<rule ref="SlevomatCodingStandard.Classes.PropertySpacing">
64+
<properties>
65+
<property name="minLinesCountBeforeWithComment" value="1" />
66+
<property name="maxLinesCountBeforeWithComment" value="1" />
67+
<property name="minLinesCountBeforeWithoutComment" value="1" />
68+
<property name="maxLinesCountBeforeWithoutComment" value="1" />
69+
</properties>
70+
</rule>
71+
72+
<!-- Require two blank lines between method declarations -->
73+
<rule ref="SlevomatCodingStandard.Classes.MethodSpacing">
74+
<properties>
75+
<property name="minLinesCount" value="2" />
76+
<property name="maxLinesCount" value="2" />
77+
</properties>
78+
</rule>
2779
</ruleset>

0 commit comments

Comments
 (0)