Repository navigation
Expand file tree
/
Copy pathphpcs.xml.dist
More file actions
106 lines (90 loc) · 4.37 KB
/
Copy pathphpcs.xml.dist
File metadata and controls
106 lines (90 loc) · 4.37 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
<?xml version="1.0"?>
<ruleset name="BoxSDK">
<description>PSR-12 coding standard for Box PHP SDK</description>
<arg name="basepath" value="."/>
<arg name="extensions" value="php"/>
<arg name="parallel" value="80"/>
<arg name="cache" value=".phpcs-cache"/>
<arg name="colors"/>
<!-- Ignore warnings, show progress of the run and show sniff names -->
<arg value="nps"/>
<!-- Directories to check -->
<file>bin</file>
<file>config</file>
<file>src</file>
<file>tests</file>
<!-- Exclude directories -->
<exclude-pattern>vendor/*</exclude-pattern>
<exclude-pattern>var/*</exclude-pattern>
<!-- Use PSR-12 as the base standard -->
<rule ref="PSR12"/>
<!-- Soft limit of 120 characters, hard limit of 0 (no absolute max) -->
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="120"/>
<property name="absoluteLineLimit" value="0"/>
</properties>
</rule>
<!-- Enforce short array syntax -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<!-- Slevomat sniffs -->
<config name="installed_paths" value="vendor/slevomat/coding-standard"/>
<!-- Remove unused use statements -->
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
<properties>
<property name="searchAnnotations" value="true"/>
</properties>
</rule>
<!-- Forbid legacy/irrelevant PHPDoc annotations -->
<rule ref="SlevomatCodingStandard.Commenting.ForbiddenAnnotations">
<properties>
<property name="forbiddenAnnotations" type="array">
<element value="@category"/>
<element value="@package"/>
<element value="@subpackage"/>
<element value="@author"/>
<element value="@copyright"/>
<element value="@license"/>
</property>
</properties>
</rule>
<!-- Remove lone @inheritDoc tags (redundant when method is fully typed) -->
<rule ref="SlevomatCodingStandard.Commenting.UselessInheritDocComment"/>
<!-- Remove entire docblocks that add no value beyond the native signature -->
<rule ref="SlevomatCodingStandard.Commenting.UselessFunctionDocComment"/>
<!-- Flag redundant @param tags (bare type-only, no description) -->
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint">
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingAnyTypeHint"/>
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint"/>
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification"/>
</rule>
<!-- Flag redundant @return tags (bare type-only, no description) -->
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint">
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingAnyTypeHint"/>
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint"/>
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification"/>
</rule>
<!-- Enforce consistent PHPDoc formatting: no blank lines before/after content, opener on its own line -->
<rule ref="SlevomatCodingStandard.Commenting.DocCommentSpacing">
<properties>
<property name="linesCountBeforeFirstContent" value="0"/>
<property name="linesCountAfterLastContent" value="0"/>
<property name="linesCountBetweenDescriptionAndAnnotations" value="1"/>
<property name="linesCountBetweenDifferentAnnotationsTypes" value="1"/>
<property name="annotationsGroups" type="array">
<element value="@api, @since"/>
<element value="@var, @param"/>
<element value="@throws, @return"/>
</property>
</properties>
</rule>
<!-- Remove unnecessary fully qualified names -->
<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly">
<properties>
<property name="searchAnnotations" value="true"/>
<property name="allowFallbackGlobalFunctions" value="true"/>
<property name="allowFallbackGlobalConstants" value="true"/>
<property name="allowFullyQualifiedExceptions" value="true"/>
</properties>
</rule>
</ruleset>