-
Notifications
You must be signed in to change notification settings - Fork 2
/
phpcs.xml.dist
60 lines (54 loc) · 2.64 KB
/
phpcs.xml.dist
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
<?xml version="1.0"?>
<ruleset name="NZTA">
<description>Coding standards for SilverStripe based project</description>
<arg name="extensions" value="php" />
<arg value="p"/> <!-- Show progress -->
<arg name="colors"/>
<arg value="s"/> <!-- output sniff names on violation -->
<arg name="encoding" value="utf-8" />
<config name="installed_paths" value="./../../slevomat/coding-standard"/>
<file>src</file>
<file>tests</file>
<!-- Don't sniff third party libraries -->
<exclude-pattern>./vendor/*</exclude-pattern>
<exclude-pattern>*/thirdparty/*</exclude-pattern>
<!-- Use PSR-12 as a base standard -->
<rule ref="PSR12">
<!-- Silverstripe convention intended for template getter methods to be in PascalCase -->
<!-- e.g. SiteTree::MetaTags() -->
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps"/>
</rule>
<!-- catch a few "tidy code" elements not covered by PSR-12 -->
<!-- clean useless code -->
<rule ref="SlevomatCodingStandard.ControlStructures.UselessTernaryOperator" />
<rule ref="SlevomatCodingStandard.Exceptions.DeadCatch" />
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
<properties>
<property name="searchAnnotations" type="bool" value="true"/>
<property name="ignoredAnnotationNames" type="array" value="@config"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.UselessAlias" />
<rule ref="SlevomatCodingStandard.PHP.UselessSemicolon" />
<rule ref="SlevomatCodingStandard.Variables.UnusedVariable">
<properties>
<property name="ignoreUnusedValuesWhenOnlyKeysAreUsedInForeach" value="true" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Variables.UselessVariable" />
<!-- formatting & style rules -->
<rule ref="SlevomatCodingStandard.Arrays.TrailingArrayComma" />
<rule ref="SlevomatCodingStandard.Classes.SuperfluousTraitNaming" />
<rule ref="SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming" />
<rule ref="SlevomatCodingStandard.Classes.SuperfluousAbstractClassNaming" />
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses" />
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
<!-- it would be nice if this rule just read from composer.json... but it doesn't seem to. -->
<properties>
<property name="rootNamespaces" type="array">
<element key="src" value="NZTA\PromoOverlay" />
<element key="tests" value="NZTA\PromoOverlay\Test" />
</property>
</properties>
</rule>
</ruleset>