-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpcs.xml.dist
More file actions
66 lines (54 loc) · 2.38 KB
/
Copy pathphpcs.xml.dist
File metadata and controls
66 lines (54 loc) · 2.38 KB
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
<?xml version="1.0"?>
<ruleset name="Metricool – PSR12 + PSR4 (Slevomat)">
<description>PSR-12 formatting and PSR-4-ish checks using Slevomat. No WordPress sniffs.</description>
<!-- Scope -->
<file>app</file>
<file>bootstrap</file>
<file>metricool.php</file>
<!-- Ignore third-party / generated -->
<exclude-pattern>vendor/*</exclude-pattern>
<exclude-pattern>node_modules/*</exclude-pattern>
<!-- Runner args -->
<arg name="encoding" value="utf-8"/>
<arg name="extensions" value="php"/>
<arg name="colors"/>
<!-- Tokenizer/env -->
<config name="php_version" value="70400"/>
<!-- Base standard -->
<rule ref="PSR12"/>
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration">
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.SpaceAfterFunction"/>
</rule>
<!--Trust that developers will do this properly at their own discretion -->
<rule ref="Generic.Files.LineLength">
<exclude name="Generic.Files.LineLength.TooLong"/>
</rule>
<!-- Slevomat: PSR-4 filename↔type + namespace hygiene -->
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
<properties>
<property name="rootNamespaces" type="array">
<element key="app" value="Metricool"/>
<element key="bootstrap" value="Metricool\Bootstrap"/>
</property>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Classes.ClassConstantVisibility"/>
<rule ref="SlevomatCodingStandard.Namespaces.NamespaceDeclaration"/>
<rule ref="SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash"/>
<rule ref="SlevomatCodingStandard.Namespaces.UseSpacing"/>
<!-- Let Slevomat treat PHPDoc/annotations as valid usages -->
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
<properties>
<property name="searchAnnotations" value="true"/>
</properties>
</rule>
<!-- Side-effects guard; ABSPATH protection is required by WordPress in every PHP file -->
<rule ref="PSR1.Files.SideEffects">
<exclude-pattern>metricool.php</exclude-pattern>
<exclude-pattern>app/*</exclude-pattern>
<exclude-pattern>bootstrap/*</exclude-pattern>
</rule>
<!-- PHPCompatibility: WP ruleset ignores what WordPress core polyfills -->
<rule ref="PHPCompatibilityWP"/>
<config name="testVersion" value="7.4-8.5"/>
</ruleset>