-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpcs.xml
113 lines (95 loc) · 4.63 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
<?xml version="1.0"?>
<ruleset name="scanpay-woocommerce-cs">
<exclude-pattern>^(?!.*\.php$).*</exclude-pattern>
<file>src</file>
<arg name="basepath" value="."/>
<arg name="colors"/>
<config name="minimum_supported_wp_version" value="4.7" />
<config name="testVersion" value="7.4-" />
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array" value="scanpay-for-woocommerce" />
</properties>
</rule>
<!-- WooCommerce Rules -->
<rule ref="WooCommerce-Core">
<exclude name="WooCommerce.Commenting.CommentHooks.MissingHookComment" />
</rule>
<!-- WordPress Rules -->
<rule ref="WordPress">
<!-- Allow short array syntax [] -->
<exclude name="Generic.Arrays.DisallowShortArraySyntax"/>
<exclude name="Universal.Arrays.DisallowShortArraySyntax"/>
<exclude name="WordPress.Security.EscapeOutput" />
<exclude name="WordPress.Security.NonceVerification.Recommended" />
<exclude name="WordPress.Security.SafeRedirect.wp_redirect_wp_redirect" />
<exclude name="WordPress.PHP.NoSilencedErrors.Discouraged" />
<exclude name="WordPress.WP.AlternativeFunctions.file_system_operations_mkdir" />
<exclude name="WordPress.WP.AlternativeFunctions.file_system_operations_rmdir" />
<exclude name="WordPress.WP.AlternativeFunctions.file_system_operations_touch" />
<!-- Only relevant to PHP 7.0 and older -->
<exclude name="WordPress.WP.AlternativeFunctions.parse_url_parse_url" />
<!-- Ignore warnings about cURL -->
<exclude name="WordPress.WP.AlternativeFunctions.curl_curl_init" />
<exclude name="WordPress.WP.AlternativeFunctions.curl_curl_reset" />
<exclude name="WordPress.WP.AlternativeFunctions.curl_curl_setopt_array" />
<exclude name="WordPress.WP.AlternativeFunctions.curl_curl_exec" />
<exclude name="WordPress.WP.AlternativeFunctions.curl_curl_strerror" />
<exclude name="WordPress.WP.AlternativeFunctions.curl_curl_errno" />
<exclude name="WordPress.WP.AlternativeFunctions.curl_curl_getinfo" />
<!-- Ignore warnings about json_encode() -->
<exclude name="WordPress.WP.AlternativeFunctions.json_encode_json_encode" />
<!-- Ignore prepared statements -->
<exclude name="WordPress.DB.PreparedSQL"/>
<exclude name="WordPress.Security.ValidatedSanitizedInput.MissingUnslash" />
<exclude name="WordPress.Security.ValidatedSanitizedInput.InputNotSanitized" />
</rule>
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<rule ref="WordPress-Extra">
<!-- Ignore documentation requirements -->
<exclude name="Squiz.Commenting" />
</rule>
<!-- Allow base64 encode -->
<rule ref="WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode">
<exclude-pattern>*</exclude-pattern>
</rule>
<!-- Allow base64 encode -->
<rule ref="WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode">
<exclude-pattern>*</exclude-pattern>
</rule>
<!-- Add 3rd-party and custom capabilities -->
<rule ref="WordPress.WP.Capabilities">
<properties>
<property name="custom_capabilities" type="array" value="manage_woocommerce,edit_shop_orders" />
</properties>
</rule>
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed">
<exclude-pattern>woocommerce-scanpay.php</exclude-pattern>
</rule>
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter.Found">
<exclude-pattern>woocommerce-scanpay.php</exclude-pattern>
</rule>
<!-- Tmp solution to allow inline add_action / add_filter -->
<rule ref="PEAR.Functions.FunctionCallSignature.MultipleArguments">
<exclude-pattern>woocommerce-scanpay.php</exclude-pattern>
<exclude-pattern>gateways/class-wc-scanpay-gateway.php</exclude-pattern>
<exclude-pattern>hooks/class-wc-scanpay-sync.php</exclude-pattern>
<exclude-pattern>hooks/wp-scanpay-thankyou.php</exclude-pattern>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket">
<exclude-pattern>woocommerce-scanpay.php</exclude-pattern>
<exclude-pattern>gateways/class-wc-scanpay-gateway.php</exclude-pattern>
<exclude-pattern>hooks/class-wc-scanpay-sync.php</exclude-pattern>
<exclude-pattern>hooks/wp-scanpay-thankyou.php</exclude-pattern>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.CloseBracketLine">
<exclude-pattern>woocommerce-scanpay.php</exclude-pattern>
<exclude-pattern>gateways/class-wc-scanpay-gateway.php</exclude-pattern>
<exclude-pattern>hooks/class-wc-scanpay-sync.php</exclude-pattern>
<exclude-pattern>hooks/wp-scanpay-thankyou.php</exclude-pattern>
</rule>
<rule ref="WordPress.Security.ValidatedSanitizedInput.InputNotValidated">
<exclude-pattern>hooks/class-wc-scanpay-sync.php</exclude-pattern>
<exclude-pattern>hooks/wp-scanpay-thankyou.php</exclude-pattern>
</rule>
</ruleset>