-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpcs.xml
113 lines (95 loc) · 5.11 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="BracketSpace Coding Style">
<config name="minimum_supported_wp_version" value="5.7"/>
<rule ref="PSR12NeutronRuleset">
<!-- NeutronStandard bug -->
<exclude name="NeutronStandard.Functions.TypeHint.NoReturnType"/>
<!-- https://github.com/sirbrillig/phpcs-import-detection/issues/45 -->
<exclude name="ImportDetection.Imports.RequireImports"/>
<!-- We write Composer packages -->
<exclude name="PEAR.Commenting.FileComment.InvalidPackage"/>
<exclude name="PEAR.Commenting.FileComment.MissingAuthorTag"/>
<exclude name="PEAR.Commenting.FileComment.MissingLicenseTag"/>
<exclude name="PEAR.Commenting.FileComment.MissingLinkTag"/>
<exclude name="PSR12.Files.FileHeader.SpacingAfterBlock"/>
<exclude name="PSR12.Properties.ConstantVisibility.NotFound"/>
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameAfterKeyword"/>
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation"/>
<exclude name="SlevomatCodingStandard.Classes.DisallowLateStaticBindingForConstants.DisallowedLateStaticBindingForConstant"/>
<exclude name="SlevomatCodingStandard.PHP.RequireExplicitAssertion.RequiredExplicitAssertion"/>
<exclude name="WordPress.NamingConventions.ValidHookName.UseUnderscores"/>
<exclude name="WordPress.WP.GlobalVariablesOverride.Prohibited"/>
<exclude name="NeutronStandard.Functions.LongFunction.LongFunction"/>
<exclude name="NeutronStandard.Functions.DisallowCallUserFunc.CallUserFunc"/>
<exclude name="SlevomatCodingStandard.Functions.DisallowArrowFunction.DisallowedArrowFunction"/>
<exclude name="NeutronStandard.MagicMethods.RiskyMagicMethod.RiskyMagicMethod"/>
<exclude name="NeutronStandard.Globals.DisallowGlobalFunctions.GlobalFunctions"/>
<exclude name="NeutronStandard.Functions.VariableFunctions.VariableFunction"/>
<exclude name="NeutronStandard.MagicMethods.DisallowMagicGet.MagicGet"/>
<exclude name="SlevomatCodingStandard.ControlStructures.DisallowEmpty.DisallowedEmpty"/>
<exclude name="SlevomatCodingStandard.Classes.ClassConstantVisibility.MissingConstantVisibility"/>
<exclude name="SlevomatCodingStandard.Operators.DisallowIncrementAndDecrementOperators.DisallowedPostIncrementOperator"/>
<exclude name="SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter"/>
<exclude name="SlevomatCodingStandard.Variables.UnusedVariable.UnusedVariable"/>
<exclude name="SlevomatCodingStandard.Arrays.DisallowImplicitArrayCreation.ImplicitArrayCreationUsed"/>
<exclude name="VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable"/>
<exclude name="Generic.WhiteSpace.DisallowTabIndent.TabsUsed"/>
<exclude name="WordPress.WP.I18n.NonSingularStringLiteralDomain"/>
<exclude name="WordPress.WP.I18n.NonSingularStringLiteralText"/>
<exclude name="WordPress.Security.NonceVerification.Recommended"/>
<exclude name="PEAR.Commenting.ClassComment.InvalidAuthors"/>
<exclude name="Generic.Files.ExecutableFile.Executable"/>
</rule>
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent" />
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="tabIndent" value="true" />
</properties>
</rule>
<arg name="extensions" value="php" />
<arg name="tab-width" value="4" />
<rule ref="Squiz.PHP.DiscouragedFunctions">
<properties>
<!--
* ini_set() environment belongs to the server
* env() does not work in production (artisan config:cache)
* eval() is dangerous!
* print and print_r() disturb templating, see wilderborn/partyline
* dump(), dd(), var_dump() - consider using barryvdh/laravel-debugbar
* error_log() has special use
* define() is for global constants
Defaults: https://github.com/squizlabs/PHP_CodeSniffer/blob/master/src/Standards/Squiz/Sniffs/PHP/DiscouragedFunctionsSniff.php
See https://github.com/WordPress/WordPress-Coding-Standards/blob/develop/WordPress/Sniffs/PHP/DiscouragedPHPFunctionsSniff.php
-->
<property name="forbiddenFunctions" type="array">
<element key="ini_set" value="null"/>
<element key="env" value="null"/>
<element key="list" value="null"/>
<element key="extract" value="null"/>
<element key="eval" value="null"/>
<element key="print" value="null"/>
<element key="print_r" value="null"/>
<element key="dump" value="null"/>
<element key="dd" value="null"/>
<element key="var_dump" value="null"/>
<element key="error_log" value="null"/>
<element key="define" value="null"/>
</property>
</properties>
</rule>
<rule ref="PHPCompatibilityWP"/>
<config name="testVersion" value="7.4-"/>
<!-- 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"/>
<exclude-pattern>node_modules/*</exclude-pattern>
<exclude-pattern>resources/js.*</exclude-pattern>
<exclude-pattern>resources/css.*</exclude-pattern>
<exclude-pattern>tests/*</exclude-pattern>
<exclude-pattern>vendor/*</exclude-pattern>
<exclude-pattern>dependencies/*</exclude-pattern>
<exclude-pattern>compat/*</exclude-pattern>
<exclude-pattern>notification.php</exclude-pattern>
</ruleset>