-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpcs.xml
More file actions
86 lines (74 loc) · 3.21 KB
/
Copy pathphpcs.xml
File metadata and controls
86 lines (74 loc) · 3.21 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?xml version="1.0"?>
<ruleset name="RooCMS Coding Standards">
<description>RooCMS PHP CodeSniffer configuration for PHP 8.1+ compatibility</description>
<!-- Use base standards -->
<rule ref="PSR12">
<!-- Exclude some rules for compatibility with the project -->
<exclude name="PSR12.Files.FileHeader"/>
<exclude name="PSR12.Operators.OperatorSpacing"/>
<exclude name="PSR12.ControlStructures.ControlStructureSpacing"/>
<exclude name="PSR12.Files.LineLength"/>
<exclude name="Generic.Files.LineLength"/>
<exclude name="Security.BadFunctions.FilesystemFunctions.Warn"/>
<exclude name="Security.BadFunctions.ExitFunctions.Warn"/>
<exclude name="Security.BadFunctions.HeaderFunctions.Warn"/>
</rule>
<!-- Rules for PHP 8.1+ -->
<rule ref="PHPCompatibility"/>
<config name="testVersion" value="8.1-"/>
<!-- Security rules -->
<rule ref="Security"/>
<!-- Exclude some rules, not suitable for pure PHP -->
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/storage/logs/*</exclude-pattern>
<exclude-pattern>*/upload/*</exclude-pattern>
<!-- Exclude markdown and documentation files -->
<exclude-pattern>*.md</exclude-pattern>
<exclude-pattern>README.md</exclude-pattern>
<exclude-pattern>RELEASE.md</exclude-pattern>
<exclude-pattern>LICENSE.md</exclude-pattern>
<exclude-pattern>*/README.md</exclude-pattern>
<exclude-pattern>*/database/README.md</exclude-pattern>
<!-- Exclude configuration files -->
<exclude-pattern>*.yml</exclude-pattern>
<exclude-pattern>*.yaml</exclude-pattern>
<exclude-pattern>*.xml</exclude-pattern>
<exclude-pattern>*.json</exclude-pattern>
<!-- Settings for files -->
<file>./roocms</file>
<file>./api</file>
<file>./storage</file>
<exclude-pattern>*/storage/logs/*.log</exclude-pattern>
<exclude-pattern>*/storage/assets/*</exclude-pattern>
<!-- Maximum line length -->
<config name="maxLineLength" value="240"/>
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="240"/>
<property name="absoluteLineLimit" value="240"/>
</properties>
</rule>
<!-- Settings for arrays -->
<rule ref="Generic.Arrays.ArrayIndent"/>
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<rule ref="Generic.Arrays.DisallowShortArraySyntax">
<severity>0</severity>
</rule>
<!-- Rules for functions -->
<rule ref="Generic.Functions.FunctionCallArgumentSpacing"/>
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie"/>
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
<properties>
<property name="equalsSpacing" value="1"/>
</properties>
</rule>
<!-- Rules for classes -->
<rule ref="Generic.Classes.DuplicateClassName"/>
<rule ref="Squiz.Classes.ValidClassName"/>
<!-- Rules for comments -->
<rule ref="Squiz.Commenting.FunctionComment"/>
<rule ref="Squiz.Commenting.VariableComment"/>
<rule ref="Squiz.Commenting.ClassComment"/>
<rule ref="Squiz.Commenting.FileComment"/>
</ruleset>