-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathphpcs.xml
More file actions
75 lines (64 loc) · 2.74 KB
/
Copy pathphpcs.xml
File metadata and controls
75 lines (64 loc) · 2.74 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
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="PHP SEO Coding Standard">
<description>Coding standard for the PHP SEO package</description>
<!-- Use PSR-12 as base -->
<rule ref="PSR12"/>
<!-- Paths to check -->
<file>src</file>
<file>tests</file>
<!-- Exclude vendor directory -->
<exclude-pattern>vendor</exclude-pattern>
<exclude-pattern>coverage-report</exclude-pattern>
<exclude-pattern>.phpunit.cache</exclude-pattern>
<!-- Additional rules -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<rule ref="Generic.Commenting.Todo"/>
<rule ref="Generic.ControlStructures.InlineControlStructure"/>
<rule ref="Generic.Formatting.DisallowMultipleStatements"/>
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
<rule ref="Generic.PHP.LowerCaseConstant"/>
<rule ref="Generic.PHP.LowerCaseKeyword"/>
<rule ref="Generic.PHP.LowerCaseType"/>
<rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
<!-- Squiz rules with exclusions -->
<rule ref="Squiz.PHP.DisallowSizeFunctionsInLoops">
<!-- Allow strlen in loops for specific performance cases -->
<exclude-pattern>src/Generators/DescriptionGenerator.php</exclude-pattern>
</rule>
<rule ref="Squiz.PHP.Eval"/>
<rule ref="Squiz.Scope.MemberVarScope"/>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
<properties>
<property name="ignoreBlankLines" value="true"/>
</properties>
</rule>
<!-- Allow longer lines for some contexts -->
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="140"/>
<property name="absoluteLineLimit" value="200"/>
</properties>
<!-- Be more lenient with tests -->
<exclude-pattern>tests</exclude-pattern>
</rule>
<!-- More lenient line length for tests -->
<rule ref="Generic.Files.LineLength.TooLong">
<exclude-pattern>tests</exclude-pattern>
</rule>
<!-- Exclude some checks for tests -->
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
<exclude-pattern>tests</exclude-pattern>
</rule>
<!-- Allow mixing symbols and side effects in test files (Pest structure) -->
<rule ref="PSR1.Files.SideEffects.FoundWithSymbols">
<exclude-pattern>tests</exclude-pattern>
</rule>
<!-- Allow global keyword in test files for mocking -->
<rule ref="Squiz.PHP.GlobalKeyword">
<exclude-pattern>tests</exclude-pattern>
</rule>
<!-- Allow classes without namespaces in Laravel tests -->
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
<exclude-pattern>tests/Unit/Integrations/Laravel</exclude-pattern>
</rule>
</ruleset>