-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathphpcs.xml
More file actions
143 lines (123 loc) · 5.98 KB
/
phpcs.xml
File metadata and controls
143 lines (123 loc) · 5.98 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<?xml version="1.0"?>
<ruleset name="PhpProxyHunter">
<description>PHPCS rules aligned with php-cs-fixer config (PSR12 + custom rules + 2-space indent)</description>
<!-- Base coding standard -->
<rule ref="PSR12">
<!-- Disable the brace-on-new-line rule for functions, classes, and interfaces -->
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine"/>
<exclude name="Squiz.Classes.ClassDeclaration.OpenBraceNewLine"/>
<exclude name="PSR2.Classes.ClassDeclaration.OpenBraceNewLine"/>
<exclude name="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace"/>
<exclude name="Generic.Classes.OpeningBraceSameLine"/>
</rule>
<!-- Disable space after class keyword for anonymous classes -->
<rule ref="PSR12.Classes.AnonClassDeclaration.SpaceAfterKeyword">
<severity>0</severity>
</rule>
<!-- Exclude rule that enforces no content after opening brace in multi-line function declarations -->
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.ContentAfterBrace"/>
<!-- Exclude rule that enforces no content before closing brace in a scope (like functions or classes) -->
<exclude name="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore"/>
<!-- Exclude rule that disallows multiple statements on the same line -->
<exclude name="Generic.Formatting.DisallowMultipleStatements.SameLine"/>
<!-- Disable rule that enforces no content after opening brace in multi-line function declarations -->
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration.ContentAfterBrace">
<severity>0</severity>
</rule>
<!-- Disable rule that enforces no content before closing brace in a scope -->
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore">
<severity>0</severity>
</rule>
<!-- Disable rule that prevents multiple statements being written on the same line -->
<rule ref="Generic.Formatting.DisallowMultipleStatements.SameLine">
<severity>0</severity>
</rule>
<!-- Disable inline control structure rule -->
<rule ref="Generic.ControlStructures.InlineControlStructure.NotAllowed">
<severity>0</severity>
</rule>
<!-- Disable header block spacing and control structure indent rules for tests/PhpProxyHunter/CoreDBTest.php -->
<rule ref="PSR12.Files.FileHeader.SpacingAfterBlock">
<severity>0</severity>
</rule>
<rule ref="PSR12.ControlStructures.ControlStructureSpacing.LineIndent">
<severity>0</severity>
</rule>
<!-- Indentation: 2 spaces -->
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="indent" value="2"/>
<property name="tabIndent" value="false"/>
<property name="exact" value="true"/>
</properties>
<exclude name="Generic.WhiteSpace.ScopeIndent.IncorrectExact"/>
</rule>
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration.Indent">
<severity>0</severity>
</rule>
<!-- Short array syntax -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<!-- Unused imports -->
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses"/>
<!-- Exclude the specific sniff for missing namespaces -->
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
<!-- disable it project-wide -->
<severity>0</severity>
</rule>
<exclude name="SlevomatCodingStandard.Namespaces.RequireNamespace"/>
<exclude name="SlevomatCodingStandard.Namespaces.RequireOneNamespaceLevel"/>
<exclude name="SlevomatCodingStandard.Namespaces.RequireMultiLevelNamespace"/>
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalFunctions"/>
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalConstants"/>
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalClasses"/>
<!-- Trailing comma in multiline arrays (disabled) -->
<rule ref="SlevomatCodingStandard.Arrays.TrailingArrayComma">
<severity>0</severity>
</rule>
<!-- disable side effect -->
<exclude name="PSR1.Files.SideEffects.FoundWithSymbols"/>
<rule ref="PSR1.Files.SideEffects">
<severity>0</severity>
</rule>
<!-- disable function call signature indent (indentation error) -->
<rule ref="PSR2.Methods.FunctionCallSignature.Indent">
<severity>0</severity>
</rule>
<!-- Disable break indent error in switch-case -->
<rule ref="PSR2.ControlStructures.SwitchDeclaration.BreakIndent">
<severity>0</severity>
</rule>
<!-- Disable multi-line control structure spacing rules -->
<rule ref="PSR12.ControlStructures.ControlStructureSpacing.FirstExpressionLine">
<severity>0</severity>
</rule>
<rule ref="PSR12.ControlStructures.ControlStructureSpacing.CloseParenthesisLine">
<severity>0</severity>
</rule>
<rule ref="Generic.Files.LineLength">
<severity>0</severity>
</rule>
<!-- Files to scan -->
<file>./</file>
<!-- Disable camelCase naming sniffs (variables, functions, methods, properties, classes) -->
<!-- Common PHPCS sniff names that enforce camelCase or enforce specific naming conventions -->
<exclude name="Generic.NamingConventions.CamelCapsFunctionName"/>
<exclude name="Generic.NamingConventions.CamelCapsVariableName"/>
<exclude name="Squiz.NamingConventions.ValidFunctionName"/>
<exclude name="Squiz.NamingConventions.ValidVariableName"/>
<exclude name="Squiz.Classes.ValidClassName"/>
<exclude name="SlevomatCodingStandard.NamingConventions.UnderscoreSeparated"/>
<exclude name="SlevomatCodingStandard.NamingConventions.ValidClassName"/>
<exclude name="SlevomatCodingStandard.NamingConventions.ValidFunctionName"/>
<exclude name="SlevomatCodingStandard.NamingConventions.ValidVariableName"/>
<!-- Exclude directories -->
<exclude-pattern>vendor/*</exclude-pattern>
<exclude-pattern>node_modules/*</exclude-pattern>
<exclude-pattern>*/tmp/*</exclude-pattern>
<exclude-pattern>adminer/*</exclude-pattern>
<exclude-pattern>phpmyadmin/*</exclude-pattern>
<exclude-pattern>phpliteadmin/*</exclude-pattern>
<exclude-pattern>simplehtmldom/*</exclude-pattern>
<exclude-pattern>.cache/*</exclude-pattern>
<exclude-pattern>vscode-plugins/*</exclude-pattern>
</ruleset>