-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpcs.xml
More file actions
86 lines (77 loc) · 3.7 KB
/
phpcs.xml
File metadata and controls
86 lines (77 loc) · 3.7 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="JOOservices UserAgent">
<description>PHP_CodeSniffer rules (Pint has priority - exclude conflicting rules)</description>
<!-- Files to check -->
<file>src</file>
<file>tests</file>
<!-- Exclude vendors -->
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/coverage/*</exclude-pattern>
<!-- PSR-12 base with exclusions for Pint compatibility -->
<rule ref="PSR12">
<!-- Allow snake_case test method names (PHPUnit convention) -->
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps"/>
<!-- Pint uses Laravel preset which allows omitting parentheses -->
<exclude name="PSR12.Classes.ClassInstantiation.MissingParentheses"/>
<!-- Pint uses single_line_empty_body - braces on same line for empty classes/methods -->
<exclude name="PSR2.Classes.ClassDeclaration.OpenBraceNewLine"/>
<exclude name="PSR2.Classes.ClassDeclaration.CloseBraceAfterBody"/>
<exclude name="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore"/>
<exclude name="PSR2.Methods.FunctionClosingBrace.SpacingBeforeClose"/>
<!-- Pint uses concat_space with no spacing - conflicts with PSR12 operator spacing -->
<exclude name="PSR12.Operators.OperatorSpacing.NoSpaceBefore"/>
<exclude name="PSR12.Operators.OperatorSpacing.NoSpaceAfter"/>
</rule>
<!-- Strict types required -->
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
<properties>
<property name="spacesCountAroundEqualsSign" value="0"/>
</properties>
</rule>
<!-- Type hints - only for source files, exclude tests -->
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<!-- Unused code - exclude specific files with intentional unused params -->
<rule ref="SlevomatCodingStandard.Variables.UnusedVariable">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="SlevomatCodingStandard.Functions.UnusedParameter">
<exclude-pattern>*/tests/*</exclude-pattern>
<exclude-pattern>*/Pickers/ModelPicker.php</exclude-pattern>
<exclude-pattern>*/Service/UserAgentService.php</exclude-pattern>
<exclude-pattern>*/Templates/Browsers/*.php</exclude-pattern>
<exclude-pattern>*/UserAgent.php</exclude-pattern>
</rule>
<!-- Line length - relaxed for templates with UA strings -->
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="120"/>
<property name="absoluteLineLimit" value="200"/>
</properties>
<exclude-pattern>*/Templates/Browsers/*</exclude-pattern>
<exclude-pattern>*/Domain/Enums/BotType.php</exclude-pattern>
</rule>
<!-- Complexity - warning only -->
<rule ref="Generic.Metrics.CyclomaticComplexity">
<properties>
<property name="complexity" value="10"/>
<property name="absoluteComplexity" value="20"/>
</properties>
<type>warning</type>
</rule>
<rule ref="Generic.Metrics.NestingLevel">
<properties>
<property name="nestingLevel" value="4"/>
<property name="absoluteNestingLevel" value="6"/>
</properties>
</rule>
<!-- Formatting - defer to Pint but validate -->
<rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
</ruleset>