some more PSR2 cleanup
[dokuwiki.git] / _test / phpcs.xml
blob4ab65b2f2612257274cb0669ba076267d756825c
1 <?xml version="1.0"?>
2 <ruleset name="DokuWiki Coding Standard Standard" namespace="DokuWiki\CS\Standard">
3     <description>Coding Standard used for DokuWiki</description>
5     <!-- default config -->
6     <arg name="colors"/>
7     <arg value="sp"/>
8     <arg name="extensions" value="php"/>
10     <ini name="memory_limit" value="-1"/>
12     <!-- where to look -->
13     <file>../inc</file>
14     <file>../lib</file>
15     <file>../bin</file>
16     <file>../doku.php</file>
17     <file>../index.php</file>
18     <file>../feed.php</file>
19     <file>../install.php</file>
21     <!-- skip these completely -->
22     <exclude-pattern>*/lang/*/lang.php</exclude-pattern>
23     <exclude-pattern>*/lang/*/settings.php</exclude-pattern>
24     <exclude-pattern>*/_test/*</exclude-pattern>
26     <!-- 3rd party libs, these should be moved to composer some day -->
27     <exclude-pattern>*/inc/DifferenceEngine.php</exclude-pattern>
28     <exclude-pattern>*/inc/IXR_Library.php</exclude-pattern>
29     <exclude-pattern>*/inc/JSON.php</exclude-pattern>
30     <exclude-pattern>*/inc/JpegMeta.php</exclude-pattern>
31     <exclude-pattern>*/lib/plugins/authad/adLDAP</exclude-pattern>
33     <!-- deprecated files to be removed soon -->
34     <exclude-pattern>*/inc/cli.php</exclude-pattern>
35     <exclude-pattern>*/inc/parser/*</exclude-pattern>
37     <!-- rules on top of PSR-2 -->
38     <rule ref="PSR2">
39         <!-- the following rule is not in PSR-2 and breaks the guardian pattern -->
40         <exclude name="Generic.ControlStructures.InlineControlStructure.NotAllowed"/>
42         <!-- we have lots of legacy classes without name spaces -->
43         <exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace"/>
44     </rule>
46     <!-- disable some rules for certain paths, for legacy support -->
47     <rule ref="Squiz.Classes.ValidClassName.NotCamelCaps">
48         <exclude-pattern>*/inc/Plugin.php</exclude-pattern>
49         <exclude-pattern>*/inc/PluginInterface.php</exclude-pattern>
50         <exclude-pattern>*/inc/PluginTrait.php</exclude-pattern>
52         <exclude-pattern>*/lib/plugins/*.php</exclude-pattern>
53         <exclude-pattern>*/lib/plugins/*/action.php</exclude-pattern>
54         <exclude-pattern>*/lib/plugins/*/action/*.php</exclude-pattern>
55         <exclude-pattern>*/lib/plugins/*/admin.php</exclude-pattern>
56         <exclude-pattern>*/lib/plugins/*/admin/*.php</exclude-pattern>
57         <exclude-pattern>*/lib/plugins/*/auth.php</exclude-pattern>
58         <exclude-pattern>*/lib/plugins/*/auth/*.php</exclude-pattern>
59         <exclude-pattern>*/lib/plugins/*/cli.php</exclude-pattern>
60         <exclude-pattern>*/lib/plugins/*/cli/*.php</exclude-pattern>
61         <exclude-pattern>*/lib/plugins/*/helper.php</exclude-pattern>
62         <exclude-pattern>*/lib/plugins/*/helper/*.php</exclude-pattern>
63         <exclude-pattern>*/lib/plugins/*/remote.php</exclude-pattern>
64         <exclude-pattern>*/lib/plugins/*/remote/*.php</exclude-pattern>
65         <exclude-pattern>*/lib/plugins/*/syntax.php</exclude-pattern>
66         <exclude-pattern>*/lib/plugins/*/syntax/*.php</exclude-pattern>
67     </rule>
69     <!-- underscore skips exposing public methods to remote api -->
70     <rule ref="PSR2.Methods.MethodDeclaration.Underscore">
71         <exclude-pattern>*/inc/Extension/RemotePlugin.php</exclude-pattern>
72         <exclude-pattern>*/lib/plugins/*/remote.php</exclude-pattern>
73         <exclude-pattern>*/lib/plugins/*/remote/*.php</exclude-pattern>
74     </rule>
76     <rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
77         <exclude-pattern>*/inc/Extension/PluginInterface.php</exclude-pattern>
78         <exclude-pattern>*/inc/Extension/PluginTrait.php</exclude-pattern>
79     </rule>
81     <!-- for now we mix declarations and execution here (mostly for defines) -->
82     <rule ref="PSR1.Files.SideEffects">
83         <exclude-pattern>*/index.php</exclude-pattern>
84         <exclude-pattern>*/inc/parserutils.php</exclude-pattern>
85         <exclude-pattern>*/inc/mail.php</exclude-pattern>
86         <exclude-pattern>*/inc/init.php</exclude-pattern>
87         <exclude-pattern>*/inc/fulltext.php</exclude-pattern>
88         <exclude-pattern>*/inc/Mailer.class.php</exclude-pattern>
89         <exclude-pattern>*/doku.php</exclude-pattern>
90         <exclude-pattern>*/install.php</exclude-pattern>
91         <exclude-pattern>*/feed.php</exclude-pattern>
92         <exclude-pattern>*/inc/load.php</exclude-pattern>
93         <exclude-pattern>*/bin/*.php</exclude-pattern>
94         <exclude-pattern>*/lib/exe/*.php</exclude-pattern>
95     </rule>
97 </ruleset>