-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.phpcs.xml
49 lines (40 loc) · 1.57 KB
/
.phpcs.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
<?xml version="1.0"?>
<ruleset name="Smolblog Core Standards" namespace="Smolblog\Core">
<description>Coding standards for the Smolblog core library.</description>
<file>./src</file>
<exclude-pattern>*/tests/*</exclude-pattern>
<arg name="extensions" value="php"/>
<arg name="tab-width" value="2"/>
<arg name="colors"/>
<ini name="memory_limit" value="64M"/>
<autoload>./vendor/autoload.php</autoload>
<!-- Use PSR-12 as our base -->
<rule ref="PSR12">
<exclude name="Generic.WhiteSpace.DisallowTabIndent"/>
<exclude name="Generic.WhiteSpace.ScopeIndent"/>
<exclude name="PSR2.Classes.ClassDeclaration.OpenBraceNewLine"/>
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine"/>
</rule>
<!-- Use tabs, please. Please. Seriously. -->
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="indent" value="2"/>
<property name="tabIndent" value="true"/>
<property name="ignoreIndentationTokens" type="array">
<element value="T_COMMENT"/>
<element value="T_DOC_COMMENT_OPEN_TAG"/>
</property>
</properties>
</rule>
<!-- Add Squiz commenting rules -->
<rule ref="Squiz.Commenting">
<!-- Functions and classes already have comments -->
<exclude name="Squiz.Commenting.FileComment"/>
<!-- Contradicted by PSR-12. -->
<exclude name="Squiz.Commenting.ClosingDeclarationComment"/>
</rule>
<!-- Make structures look nicer -->
<rule ref="Generic.Classes.OpeningBraceSameLine"/>
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie"/>
</ruleset>