Repository navigation
Expand file tree
/
Copy pathphpcs.xml
More file actions
61 lines (61 loc) · 2.9 KB
/
Copy pathphpcs.xml
File metadata and controls
61 lines (61 loc) · 2.9 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
<?xml version="1.0"?>
<ruleset name="PHP_CodeSniffer">
<rule ref="PSR12"> <!-- ruleset standard -->
<exclude name="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace"/>
<exclude name="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpaceBeforeEquals"/>
<exclude name="Generic.WhiteSpace.ScopeIndent.IncorrectExact"/>
</rule>
<rule ref="Generic.Formatting.MultipleStatementAlignment">
<type>error</type>
</rule>
<rule ref="Generic.WhiteSpace.ArbitraryParenthesesSpacing">
<properties>
<property name="ignoreNewlines" value="true" />
<property name="spacing" value="1" />
</properties>
</rule>
<rule ref="Generic.Arrays.DisallowLongArraySyntax" />
<rule ref="Squiz.Arrays.ArrayBracketSpacing"/>
<rule ref="Squiz.Arrays.ArrayDeclaration">
<!-- …but suppress bits we don’t want -->
<exclude name="Squiz.Arrays.ArrayDeclaration.NoComma"/>
<exclude name="Squiz.Arrays.ArrayDeclaration.NoCommaAfterLast"/>
<exclude name="Squiz.Arrays.ArrayDeclaration.KeyNotAligned"/>
<exclude name="Squiz.Arrays.ArrayDeclaration.ValueNotAligned"/>
<exclude name="Squiz.Arrays.ArrayDeclaration.CloseBraceNotAligned"/>
<exclude name="Squiz.Arrays.ArrayDeclaration.SingleLineNotAllowed"/>
</rule>
<!-- Enforce a single 4-space indent for every key/value line -->
<rule ref="Generic.Arrays.ArrayIndent">
<properties>
<property name="indent" value="4"/>
</properties>
</rule>
<rule ref="Squiz.Strings.DoubleQuoteUsage.NotRequired"/>
<rule ref="Generic.PHP.ForbiddenFunctions"/>
<rule ref="Generic.WhiteSpace.SpreadOperatorSpacingAfter"/>
<rule ref="Generic.ControlStructures.InlineControlStructure"/>
<rule ref="Generic.Formatting.SpaceAfterCast"/>
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="200"/>
<property name="absoluteLineLimit" value="220"/>
</properties>
</rule>
<!-- auth/*.php are HTTP endpoint entry points that intentionally mix
function declarations (jsonResponse, redirectWithError) with side
effects (require_once, dotenv load, header() calls). PSR-1's
"no symbols + side effects" rule is the right default for library
code but doesn't fit endpoint files of this shape. -->
<rule ref="PSR1.Files.SideEffects.FoundWithSymbols">
<exclude-pattern>auth/*.php</exclude-pattern>
</rule>
<file>./</file> <!-- directory you want to analyze -->
<exclude-pattern>/vendor/</exclude-pattern>
<exclude-pattern>/node_modules/</exclude-pattern>
<exclude-pattern>/examples</exclude-pattern>
<exclude-pattern>*Test.php</exclude-pattern>
<exclude-pattern>allowedOrigins.php</exclude-pattern>
<arg name="encoding" value="utf-8"/>
<arg name="extensions" value="php"/>
</ruleset>