-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpcs.xml
85 lines (74 loc) · 3.4 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
<?xml version="1.0"?>
<ruleset name="BracketSpace Coding Style">
<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="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameAfterKeyword"/>
<exclude name="WordPress.NamingConventions.ValidHookName.UseUnderscores"/>
<exclude name="NeutronStandard.Functions.LongFunction.LongFunction"/>
<exclude name="SlevomatCodingStandard.Functions.DisallowArrowFunction.DisallowedArrowFunction"/>
<exclude name="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterOpen"/>
<exclude name="NeutronStandard.MagicMethods.DisallowMagicGet.MagicGet"/>
<exclude name="NeutronStandard.MagicMethods.RiskyMagicMethod.RiskyMagicMethod"/>
<exclude name="NeutronStandard.MagicMethods.DisallowMagicSet.MagicSet"/>
</rule>
<rule ref="PSR12">
<exclude name="PSR12.Files.FileHeader" />
<exclude name="PSR12.Files.OpenTag" />
<exclude name="Generic.WhiteSpace.DisallowTabIndent" />
</rule>
<!-- Use tabs instead of spaces for indentation -->
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent" />
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="tabIndent" value="true" />
</properties>
</rule>
<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>
<!-- 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>bin/*</exclude-pattern>
<exclude-pattern>node_modules/*</exclude-pattern>
<exclude-pattern>tests/*</exclude-pattern>
<exclude-pattern>vendor/*</exclude-pattern>
<exclude-pattern>src/Dependencies/*</exclude-pattern>
</ruleset>