forked from Nullcorps/woocommerce-gateway-bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathphpcs.xml
More file actions
168 lines (155 loc) · 6.83 KB
/
Copy pathphpcs.xml
File metadata and controls
168 lines (155 loc) · 6.83 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
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
162
163
164
165
166
167
168
<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards for Plugins">
<description>Generally-applicable sniffs for WordPress plugins</description>
<rule ref="WordPress" />
<!-- Check all PHP files in directory tree by default. -->
<arg name="extensions" value="php"/>
<file>.</file>
<!-- Show progress and sniff codes in all reports -->
<arg value="ps"/>
<!-- Show colors -->
<arg name="colors"/>
<exclude-pattern>/assets/</exclude-pattern>
<exclude-pattern>/dist-archive/</exclude-pattern>
<exclude-pattern>/node_modules/</exclude-pattern>
<exclude-pattern>/scratch/</exclude-pattern>
<exclude-pattern>/tests/_data/</exclude-pattern>
<exclude-pattern>/tests/_output/</exclude-pattern>
<exclude-pattern>/tests/_support/</exclude-pattern>
<exclude-pattern>/tests/e2e/</exclude-pattern>
<exclude-pattern>/vendor-prefixed/*</exclude-pattern>
<exclude-pattern>/vendor/*</exclude-pattern>
<exclude-pattern>/wordpress/</exclude-pattern>
<exclude-pattern>/wp-content/plugins</exclude-pattern>
<exclude-pattern>/wp-content/themes</exclude-pattern>
<exclude-pattern>/wp-content/uploads</exclude-pattern>
<exclude-pattern>/phpstanbootstrap.php</exclude-pattern>
<!-- Configure custom capabilities -->
<rule ref="WordPress.WP.Capabilities">
<properties>
<property name="custom_capabilities" type="array">
<element value="manage_woocommerce"/>
<element value="read_private_shop_orders"/>
</property>
</properties>
</rule>
<!-- Do not require the object type in the comment, presuming it is strongly typed -->
<rule ref="Squiz.Commenting.VariableComment.MissingVar">
<exclude-pattern>*</exclude-pattern>
</rule>
<!-- Allow unused parameters. I find it helpful to know what is available. -->
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed">
<exclude-pattern>*</exclude-pattern>
</rule>
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter.Found">
<exclude-pattern>*</exclude-pattern>
</rule>
<!-- I'm not really sure how this is a security problem. -->
<rule ref="WordPress.Security.EscapeOutput.ExceptionNotEscaped">
<exclude-pattern>*</exclude-pattern>
</rule>
<!-- No need for comment when the purpose is to type annotate. -->
<rule ref="Generic.Commenting.DocComment.MissingShort">
<exclude-pattern>*</exclude-pattern>
</rule>
<rule ref="Universal.Operators.DisallowShortTernary.Found">
<exclude-pattern>*</exclude-pattern>
</rule>
<!-- Often getting an error that disagrees with PhpStorm's determination. -->
<rule ref="Squiz.Commenting.FunctionCommentThrowTag.WrongNumber">
<exclude-pattern>*</exclude-pattern>
</rule>
<!-- Enforce fewer rules on tests -->
<rule ref="Generic.Commenting.DocComment.MissingShort">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="Internal.NoCodeFound">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="PEAR.NamingConventions.ValidClassName.Invalid">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="PSR2.Methods.MethodDeclaration.Underscore">
<exclude-pattern>*/tests/acceptance/*</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.ClassComment.Missing">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.FileComment.Missing">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.FunctionComment.Missing">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.FunctionComment.EmptyThrows">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.VariableComment.Missing">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="Squiz.PHP.DisallowMultipleAssignments.Found">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.DB.DirectDatabaseQuery.DirectQuery">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.DB.DirectDatabaseQuery.NoCaching">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.DB.DirectDatabaseQuery.SchemaChange">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.Files.FileName.InvalidClassFileName">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.Files.FileName.NotHyphenatedLowercase">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid">
<exclude-pattern>*/tests/acceptance/*</exclude-pattern>
</rule>
<rule ref="WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase">
<exclude-pattern>*/tests/acceptance/*</exclude-pattern>
</rule>
<rule ref="WordPress.PHP.DevelopmentFunctions.error_log_set_error_handler">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.Security.NonceVerification.Recommended">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.Security.ValidatedSanitizedInput.InputNotValidated">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.Security.ValidatedSanitizedInput.InputNotSanitized">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.Security.ValidatedSanitizedInput.MissingUnslash">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.WP.GlobalVariablesOverride.Prohibited">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.NamingConventions.ValidVariableName.PropertyNotSnakeCase">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter.Found">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions.json_encode_json_encode">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<!-- Don't report exceptions' throw tags in tests. -->
<rule ref="Squiz.Commenting.FunctionCommentThrowTag.Missing">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<!-- Allow development functions in the development plugin -->
<rule ref="WordPress.PHP.DevelopmentFunctions.error_log_print_r">
<exclude-pattern>*/development-plugin/*</exclude-pattern>
</rule>
<rule ref="WordPress.Security.NonceVerification.Recommended">
<exclude-pattern>*/development-plugin/*</exclude-pattern>
</rule>
</ruleset>