-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpcs.xml
More file actions
78 lines (65 loc) · 3.91 KB
/
phpcs.xml
File metadata and controls
78 lines (65 loc) · 3.91 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
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
<config name="php_version" value="80000"/>
<arg value="ps"/>
<arg name="colors"/>
<arg name="parallel" value="16"/>
<file>Console</file>
<file>tests</file>
<rule ref="CakePHP">
<!-- ===== Namespace and Class Rules ===== -->
<!-- CakePHP2 uses App::uses() instead of namespaces -->
<exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace"/>
<!-- CakePHP2 uses App::uses() which PSR1 considers side effects -->
<exclude name="PSR1.Files.SideEffects.FoundWithSymbols"/>
<!-- Don't enforce filename matching class name (CakePHP2 has specific conventions) -->
<exclude name="Squiz.Classes.ClassFileName.NoMatch"/>
<!-- ===== Namespace/Import Rules ===== -->
<!-- Allow fully qualified class names without namespace (CakePHP2 uses global namespace) -->
<exclude name="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedNameWithoutNamespace"/>
<!-- Don't require fully qualified class names in annotations (CakePHP2 has no namespaces) -->
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation.NonFullyQualifiedClassName"/>
<!-- ===== Type Hints Rules ===== -->
<!-- Exclude type hints rules as CakePHP2 doesn't support PHP 7+ type declarations -->
<exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint"/>
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint"/>
<exclude name="SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing"/>
<!-- ===== Variable Naming Rules ===== -->
<!-- Allow CakePHP2 style variable naming ($Model, $LinkModel, $_locale, etc.) -->
<exclude name="Zend.NamingConventions.ValidVariableName.StringVarNotCamelCaps"/>
<!-- Allow underscore in public properties (CakePHP2 convention) -->
<exclude name="Zend.NamingConventions.ValidVariableName.PublicHasUnderscore"/>
<!-- Allow double underscore public properties (CakePHP2 internal convention) -->
<exclude name="Zend.NamingConventions.ValidVariableName.PublicVarHasUnderscore"/>
<!-- ===== Control Structure Rules ===== -->
<!-- Allow assignment in conditions (common pattern in CakePHP2: while ($row = $result->fetch())) -->
<exclude name="SlevomatCodingStandard.ControlStructures.AssignmentInCondition.AssignmentInCondition"/>
<!-- ===== Formatting Rules ===== -->
<!-- Allow blank lines after function comments (CakePHP2 style) -->
<exclude name="CakePHP.Commenting.FunctionComment.SpacingAfter"/>
<!-- Exclude line length checks for CakePHP2 -->
<exclude name="Generic.Files.LineLength"/>
</rule>
<!-- Include additional whitespace checking rule -->
<rule ref="Generic.Formatting.MultipleStatementAlignment">
<properties>
<property name="maxPadding" value="1"/>
</properties>
</rule>
<rule ref="CakePHP.Commenting.FunctionComment.Missing">
<exclude-pattern>tests/TestCase/*</exclude-pattern>
</rule>
<!-- Allow multiple classes in test files only (CakePHP2 test pattern) -->
<rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses">
<exclude-pattern>tests/TestCase/*</exclude-pattern>
</rule>
<!-- Allow non-camelCase method names in Console Commands (CakePHP2 shell method naming convention) -->
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
<exclude-pattern>Console/Command/*</exclude-pattern>
</rule>
<!-- Require return type hints for tests/TestCase only -->
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint">
<include-pattern>tests/TestCase/*</include-pattern>
</rule>
</ruleset>