-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpcs.xml
More file actions
117 lines (117 loc) · 6.56 KB
/
phpcs.xml
File metadata and controls
117 lines (117 loc) · 6.56 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
<?xml version="1.0"?>
<ruleset name="Manychois">
<config name="installed_paths" value="vendor/slevomat/coding-standard" />
<file>./src</file>
<arg name="extensions" value="php" />
<arg name="colors" />
<rule ref="PSR12">
<!-- Exclude PSR2 property rules that don't understand PHP 8.4 property hooks -->
<exclude name="PSR2.Classes.PropertyDeclaration.Multiple"/>
<exclude name="PSR2.Classes.PropertyDeclaration.ScopeMissing"/>
<exclude name="PSR2.Classes.PropertyDeclaration.SpacingAfterType"/>
</rule>
<!-- PHPCS parse layer treats interface property hooks as member vars; PHP 8.4 allows hooks on interfaces. -->
<rule ref="Internal.ParseError.InterfaceHasMemberVar">
<severity>0</severity>
</rule>
<!-- Align docblock asterisks and spacing before @tags (fixable by phpcbf). -->
<rule ref="Squiz.Commenting.DocCommentAlignment" />
<!-- Require `/** ... */` on public and protected methods (not private). Other PEAR function-comment checks are disabled. -->
<rule ref="PEAR.Commenting.FunctionComment">
<properties>
<property name="minimumVisibility" value="protected"/>
</properties>
<exclude name="PEAR.Commenting.FunctionComment.SpacingAfter"/>
<exclude name="PEAR.Commenting.FunctionComment.EmptySees"/>
<exclude name="PEAR.Commenting.FunctionComment.DuplicateReturn"/>
<exclude name="PEAR.Commenting.FunctionComment.MissingReturnType"/>
<exclude name="PEAR.Commenting.FunctionComment.MissingReturn"/>
<exclude name="PEAR.Commenting.FunctionComment.InvalidThrows"/>
<exclude name="PEAR.Commenting.FunctionComment.MissingParamComment"/>
<exclude name="PEAR.Commenting.FunctionComment.MissingParamName"/>
<exclude name="PEAR.Commenting.FunctionComment.MissingParamType"/>
<exclude name="PEAR.Commenting.FunctionComment.SpacingAfterParamType"/>
<exclude name="PEAR.Commenting.FunctionComment.ParamNameNoMatch"/>
<exclude name="PEAR.Commenting.FunctionComment.ParamNameNoCaseMatch"/>
<exclude name="PEAR.Commenting.FunctionComment.ExtraParamComment"/>
<exclude name="PEAR.Commenting.FunctionComment.SpacingAfterParamName"/>
<exclude name="PEAR.Commenting.FunctionComment.ParamCommentAlignment"/>
<exclude name="PEAR.Commenting.FunctionComment.ParamCommentAlignmentExceeded"/>
<exclude name="PEAR.Commenting.FunctionComment.MissingParamTag"/>
</rule>
<!-- Require `/** ... */` on class, interface, trait, and enum (PEAR sniff). PEAR file-style @package/@author tags are disabled. -->
<rule ref="PEAR.Commenting.ClassComment">
<exclude name="PEAR.Commenting.ClassComment.MissingCategoryTag"/>
<exclude name="PEAR.Commenting.ClassComment.MissingPackageTag"/>
<exclude name="PEAR.Commenting.ClassComment.MissingAuthorTag"/>
<exclude name="PEAR.Commenting.ClassComment.MissingLicenseTag"/>
<exclude name="PEAR.Commenting.ClassComment.MissingLinkTag"/>
<exclude name="PEAR.Commenting.ClassComment.CategoryTagOrder"/>
<exclude name="PEAR.Commenting.ClassComment.PackageTagOrder"/>
<exclude name="PEAR.Commenting.ClassComment.SubpackageTagOrder"/>
<exclude name="PEAR.Commenting.ClassComment.AuthorTagOrder"/>
<exclude name="PEAR.Commenting.ClassComment.CopyrightTagOrder"/>
<exclude name="PEAR.Commenting.ClassComment.LicenseTagOrder"/>
<exclude name="PEAR.Commenting.ClassComment.VersionTagOrder"/>
<exclude name="PEAR.Commenting.ClassComment.LinkTagOrder"/>
<exclude name="PEAR.Commenting.ClassComment.SeeTagOrder"/>
<exclude name="PEAR.Commenting.ClassComment.SinceTagOrder"/>
<exclude name="PEAR.Commenting.ClassComment.DeprecatedTagOrder"/>
<exclude name="PEAR.Commenting.ClassComment.InvalidCategory"/>
<exclude name="PEAR.Commenting.ClassComment.InvalidPackage"/>
<exclude name="PEAR.Commenting.ClassComment.InvalidPackageValue"/>
<exclude name="PEAR.Commenting.ClassComment.InvalidSubpackage"/>
<exclude name="PEAR.Commenting.ClassComment.InvalidAuthors"/>
<exclude name="PEAR.Commenting.ClassComment.CopyrightHyphen"/>
<exclude name="PEAR.Commenting.ClassComment.IncompleteCopyright"/>
<exclude name="PEAR.Commenting.ClassComment.InvalidCopyright"/>
<exclude name="PEAR.Commenting.ClassComment.IncompleteLicense"/>
<exclude name="PEAR.Commenting.ClassComment.InvalidVersion"/>
</rule>
<!-- Drop unused imports and keep `use` sorted (class / function / const groups per PSR-12). -->
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
<properties>
<!-- Count types used only in PHPDoc (@param, @return, @var, templates, etc.). -->
<property name="searchAnnotations" value="true"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses">
<properties>
<property name="psr12Compatible" value="true"/>
</properties>
</rule>
<!-- Native PHP classes: use `use` imports (no leading `\`). Global functions/constants may use `\`, unqualified names, or `use function` / `use const` (not required). -->
<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly">
<properties>
<property name="searchAnnotations" value="true"/>
<property name="allowFullyQualifiedGlobalClasses" value="false"/>
<property name="allowFullyQualifiedGlobalFunctions" value="true"/>
<property name="allowFullyQualifiedGlobalConstants" value="true"/>
<property name="allowFullyQualifiedExceptions" value="false"/>
<property name="allowFallbackGlobalFunctions" value="true"/>
<property name="allowFallbackGlobalConstants" value="true"/>
</properties>
</rule>
<!-- Require declare(strict_types=1); with blank line after <?php and before following code (matches project style). -->
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
<properties>
<property name="declareOnFirstLine" value="false"/>
<property name="linesCountBeforeDeclare" value="1"/>
<property name="linesCountAfterDeclare" value="1"/>
<property name="spacesCountAroundEqualsSign" value="0"/>
</properties>
</rule>
<!-- Prefer ?T over T|null for simple nullable types in native parameter, return, and property hints. -->
<rule ref="SlevomatCodingStandard.TypeHints.DNFTypeHintFormat">
<properties>
<property name="shortNullable" value="yes"/>
</properties>
</rule>
<!-- Require empty line between different annotation types (e.g., @param and @return). -->
<rule ref="SlevomatCodingStandard.Commenting.DocCommentSpacing">
<properties>
<!-- 1 empty line between @param, @return, @throws, etc. -->
<property name="linesCountBetweenDifferentAnnotationsTypes" value="1"/>
</properties>
</rule>
</ruleset>