-
Notifications
You must be signed in to change notification settings - Fork 11
/
phpcs-ruleset.xml
79 lines (67 loc) · 3.17 KB
/
phpcs-ruleset.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?xml version="1.0"?>
<!-- PHP_CodeSniffer ruleset for TaskRunner. -->
<!-- See http://pear.php.net/manual/en/package.php.php-codesniffer.annotated-ruleset.php -->
<ruleset name="TaskRunner">
<description>TaskRunner coding standard</description>
<!-- Include the Slevomat sniffs. -->
<rule ref="./vendor/squizlabs/php_codesniffer/src/Standards/PSR12" />
<config name="installed_paths" value="../../slevomat/coding-standard"/>
<!-- Exclude unsupported file types. -->
<exclude-pattern>*.gif</exclude-pattern>
<exclude-pattern>*.less</exclude-pattern>
<exclude-pattern>*.png</exclude-pattern>
<!-- Minified files don't have to comply with coding standards. -->
<exclude-pattern>*.min.css</exclude-pattern>
<exclude-pattern>*.min.js</exclude-pattern>
<!-- Require classes to be documented using docblock comments. -->
<rule ref="PEAR.Commenting.ClassComment.Missing"/>
<rule ref="PEAR.Commenting.ClassComment.WrongStyle"/>
<rule ref="Squiz.CSS.EmptyClassDefinition"/>
<!-- Require the strict types declaration in every PHP file. -->
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
<properties>
<property name="spacesCountAroundEqualsSign" value="0"/>
</properties>
</rule>
<!-- Detect unused use statements. -->
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses"/>
<!-- Require nullable types to be preceded by the nullability symbol. -->
<rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue"/>
<!-- Forbid obsolete annotations which are superseded by annotations and version control. -->
<rule ref="SlevomatCodingStandard.Commenting.ForbiddenAnnotations">
<properties>
<property name="forbiddenAnnotations" type="array">
<element value="@author"/>
<element value="@created"/>
<element value="@copyright"/>
<element value="@license"/>
<element value="@package"/>
<element value="@version"/>
</property>
</properties>
</rule>
<!-- Forbid unhelpful documentation auto-generated by IDEs. -->
<rule ref="SlevomatCodingStandard.Commenting.ForbiddenComments">
<properties>
<property name="forbiddenCommentPatterns" type="array">
<element value="/^Class [a-zA-z]*\.?$/"/>
<element value="/^Interface [a-zA-z]*\.?$/"/>
</property>
</properties>
</rule>
<!-- Enforce correct formatting of type hints for return types. -->
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing"/>
<!-- Use statements should be ordered alphabetically. -->
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses">
<properties>
<property name="caseSensitive" value="true"/>
</properties>
</rule>
<!-- The concatenation operator should be surrounded with a space. -->
<rule ref="Squiz.Strings.ConcatenationSpacing">
<properties>
<property name="spacing" value="1"/>
<property name="ignoreNewlines" value="true"/>
</properties>
</rule>
</ruleset>