-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
.phpcs.xml
161 lines (144 loc) · 7.2 KB
/
.phpcs.xml
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<?xml version="1.0"?>
<ruleset name="Einsatzverwaltung">
<description>Custom ruleset for the Einsatzverwaltung plugin.</description>
<!-- What to scan -->
<file>.</file>
<exclude-pattern>/.idea/*</exclude-pattern>
<exclude-pattern>/vendor/*</exclude-pattern>
<!-- How to scan -->
<arg value="sp"/> <!-- Show sniff and progress -->
<arg name="colors"/> <!-- Show results with colors -->
<arg name="basepath" value="."/> <!-- Strip the file paths down to the relevant bit -->
<arg name="extensions" value="php"/> <!-- Limit to PHP files -->
<!-- The PHP version range to test -->
<config name="testVersion" value="7.1-"/>
<!-- PHPCompatibility standard with adjustments for WordPress -->
<rule ref="PHPCompatibilityWP"/>
<!-- For now, continue to use the PSR2 standard. This requires to deactivate the line length sniff, because gettext calls cannot be wrapped -->
<rule ref="PSR2">
<exclude name="Generic.Files.LineLength"/>
</rule>
<rule ref="PSR2.Classes.PropertyDeclaration.Underscore">
<severity>5</severity>
</rule>
<rule ref="PSR2.Methods.MethodDeclaration.Underscore">
<severity>5</severity>
</rule>
<rule ref="PSR2.Namespaces.NamespaceDeclaration"/>
<!-- For help in understanding these custom sniff properties:
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties -->
<config name="minimum_wp_version" value="5.6"/>
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="einsatzverwaltung"/>
<element value="default"/>
</property>
</properties>
</rule>
<rule ref="WordPress.WP.I18n.MissingTranslatorsComment">
<type>error</type>
</rule>
<rule ref="WordPress.WP.I18n.TranslatorsCommentWrongStyle">
<type>error</type>
</rule>
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<exclude-pattern>tests/</exclude-pattern>
<properties>
<property name="prefixes" type="array">
<element value="einsatzverwaltung"/>
<element value="abrain\Einsatzverwaltung"/>
</property>
</properties>
</rule>
<rule ref="Modernize.FunctionCalls.Dirname.Nested"/>
<rule ref="Generic.PHP.DeprecatedFunctions"/>
<rule ref="Generic.PHP.ForbiddenFunctions"/>
<rule ref="Generic.PHP.Syntax"/>
<rule ref="Generic.Functions.CallTimePassByReference"/>
<rule ref="Generic.CodeAnalysis.EmptyStatement"/>
<rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/>
<rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall"/>
<rule ref="Generic.CodeAnalysis.JumbledIncrementer"/>
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
<rule ref="Generic.Classes.DuplicateClassName"/>
<rule ref="Generic.Strings.UnnecessaryStringConcat">
<properties>
<property name="allowMultiline" value="true"/>
</properties>
</rule>
<rule ref="Generic.CodeAnalysis.RequireExplicitBooleanOperatorPrecedence"/>
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter">
<!-- Allow for callback functions which may not need all parameters passed. -->
<exclude name="Generic.CodeAnalysis.UnusedFunctionParameter.FoundBeforeLastUsed"/>
<!-- Allow for functions in extended classes/implemented interfaces. -->
<exclude name="Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass"/>
<exclude name="Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed"/>
<exclude name="Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed"/>
<exclude name="Generic.CodeAnalysis.UnusedFunctionParameter.FoundInImplementedInterface"/>
<exclude name="Generic.CodeAnalysis.UnusedFunctionParameter.FoundInImplementedInterfaceBeforeLastUsed"/>
<exclude name="Generic.CodeAnalysis.UnusedFunctionParameter.FoundInImplementedInterfaceAfterLastUsed"/>
</rule>
<rule ref="Squiz.Classes.SelfMemberReference.NotUsed"/>
<rule ref="Squiz.Functions.FunctionDuplicateArgument"/>
<rule ref="Squiz.Operators.IncrementDecrementUsage"/>
<rule ref="Squiz.Operators.ValidLogicalOperators"/>
<rule ref="Squiz.PHP.CommentedOutCode">
<properties>
<property name="maxPercentage" value="40"/>
</properties>
</rule>
<rule ref="Squiz.PHP.DisallowSizeFunctionsInLoops"/>
<rule ref="Squiz.PHP.NonExecutableCode"/>
<rule ref="Universal.Arrays.DuplicateArrayKey"/>
<rule ref="Universal.CodeAnalysis.ConstructorDestructorReturn"/>
<rule ref="Universal.CodeAnalysis.ForeachUniqueAssignment"/>
<rule ref="Universal.CodeAnalysis.NoDoubleNegative"/>
<rule ref="Universal.CodeAnalysis.NoEchoSprintf"/>
<rule ref="Universal.CodeAnalysis.StaticInFinalClass"/>
<rule ref="Universal.ControlStructures.DisallowLonelyIf"/>
<rule ref="Universal.Files.SeparateFunctionsFromOO"/>
<rule ref="WordPress.CodeAnalysis.EscapedNotTranslated"/>
<rule ref="WordPress.NamingConventions.ValidPostTypeSlug"/>
<rule ref="WordPress.PHP.DevelopmentFunctions"/>
<rule ref="WordPress.PHP.DiscouragedPHPFunctions"/>
<rule ref="WordPress.PHP.IniSet"/>
<rule ref="WordPress.PHP.PregQuoteDelimiter"/>
<rule ref="WordPress.Security.SafeRedirect"/>
<rule ref="WordPress.Security.PluginMenuSlug"/>
<rule ref="WordPress.WP.DeprecatedFunctions"/>
<rule ref="WordPress.WP.DeprecatedClasses"/>
<rule ref="WordPress.WP.DeprecatedParameters"/>
<rule ref="WordPress.WP.DeprecatedParameterValues"/>
<rule ref="WordPress.WP.AlternativeFunctions"/>
<rule ref="WordPress.WP.DiscouragedConstants"/>
<rule ref="WordPress.WP.DiscouragedFunctions"/>
<rule ref="WordPress.WP.EnqueuedResourceParameters"/>
<rule ref="WordPress.WP.CronInterval"/>
<rule ref="WordPress.WP.PostsPerPage"/>
<rule ref="WordPress.WP.EnqueuedResources"/>
<rule ref="WordPress.WP.GlobalVariablesOverride">
<exclude-pattern>tests/</exclude-pattern>
</rule>
<rule ref="WordPress.WP.Capabilities">
<properties>
<property name="custom_capabilities" type="array">
<element value="edit_einsatzbericht"/>
<element value="read_einsatzbericht"/>
<element value="delete_einsatzbericht"/>
<element value="edit_einsatzberichte"/>
<element value="edit_others_einsatzberichte"/>
<element value="publish_einsatzberichte"/>
<element value="read_private_einsatzberichte"/>
<element value="delete_einsatzberichte"/>
<element value="delete_private_einsatzberichte"/>
<element value="delete_published_einsatzberichte"/>
<element value="delete_others_einsatzberichte"/>
<element value="edit_private_einsatzberichte"/>
<element value="edit_published_einsatzbericht"/>
</property>
</properties>
</rule>
</ruleset>