xref: /dokuwiki/_test/phpcs.xml (revision f42515548aab88878ae4121496a4e70a00b6af63)
1994e9d4eSAndreas Gohr<?xml version="1.0"?>
2994e9d4eSAndreas Gohr<ruleset name="DokuWiki Coding Standard Standard" namespace="DokuWiki\CS\Standard">
3994e9d4eSAndreas Gohr    <description>Coding Standard used for DokuWiki</description>
499c1e5dfSAndreas Gohr
599c1e5dfSAndreas Gohr    <!-- default config -->
699c1e5dfSAndreas Gohr    <arg name="colors"/>
799c1e5dfSAndreas Gohr    <arg value="sp"/>
899c1e5dfSAndreas Gohr    <arg name="extensions" value="php"/>
999c1e5dfSAndreas Gohr
10b196d8deSAndreas Gohr    <ini name="memory_limit" value="-1" />
11b196d8deSAndreas Gohr
1299c1e5dfSAndreas Gohr    <!-- where to look -->
13994e9d4eSAndreas Gohr    <file>../inc</file>
14994e9d4eSAndreas Gohr    <file>../lib</file>
15994e9d4eSAndreas Gohr    <file>../bin</file>
16994e9d4eSAndreas Gohr    <file>../doku.php</file>
17994e9d4eSAndreas Gohr    <file>../index.php</file>
18994e9d4eSAndreas Gohr    <file>../feed.php</file>
19994e9d4eSAndreas Gohr    <file>../install.php</file>
2099c1e5dfSAndreas Gohr
2199c1e5dfSAndreas Gohr    <!-- skip these completely -->
22994e9d4eSAndreas Gohr    <exclude-pattern>*/lang/*/lang.php</exclude-pattern>
23994e9d4eSAndreas Gohr    <exclude-pattern>*/lang/*/settings.php</exclude-pattern>
24994e9d4eSAndreas Gohr    <exclude-pattern>*/_test/*</exclude-pattern>
2599c1e5dfSAndreas Gohr
2699c1e5dfSAndreas Gohr    <!-- 3rd party libs, these should be moved to composer some day -->
2799c1e5dfSAndreas Gohr    <exclude-pattern>*/inc/DifferenceEngine.php</exclude-pattern>
2899c1e5dfSAndreas Gohr    <exclude-pattern>*/inc/IXR_Library.php</exclude-pattern>
2999c1e5dfSAndreas Gohr    <exclude-pattern>*/inc/JSON.php</exclude-pattern>
3099c1e5dfSAndreas Gohr    <exclude-pattern>*/inc/JpegMeta.php</exclude-pattern>
3109d57d5aSAndreas Gohr    <exclude-pattern>*/lib/plugins/authad/adLDAP</exclude-pattern>
3299c1e5dfSAndreas Gohr
33dd8af038SAndreas Gohr    <!-- deprecated files to be removed soon -->
34dd8af038SAndreas Gohr    <exclude-pattern>*/inc/cli.php</exclude-pattern>
35dd8af038SAndreas Gohr
36994e9d4eSAndreas Gohr    <!-- rules on top of PSR-2 -->
37994e9d4eSAndreas Gohr    <rule ref="PSR2">
38994e9d4eSAndreas Gohr        <!-- the following rule is not in PSR-2 and breaks the guardian pattern -->
39994e9d4eSAndreas Gohr        <exclude name="Generic.ControlStructures.InlineControlStructure.NotAllowed"/>
404b3d1701SAndreas Gohr
414b3d1701SAndreas Gohr        <!-- we have lots of legacy classes without name spaces -->
424b3d1701SAndreas Gohr        <exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace"/>
43994e9d4eSAndreas Gohr    </rule>
4499c1e5dfSAndreas Gohr
4599c1e5dfSAndreas Gohr    <!-- disable some rules for certain paths, for legacy support -->
4699c1e5dfSAndreas Gohr    <rule ref="Squiz.Classes.ValidClassName.NotCamelCaps">
4799c1e5dfSAndreas Gohr        <exclude-pattern>*/inc/parser/*</exclude-pattern>
4899c1e5dfSAndreas Gohr
4999c1e5dfSAndreas Gohr        <exclude-pattern>*/inc/Plugin.php</exclude-pattern>
5099c1e5dfSAndreas Gohr        <exclude-pattern>*/inc/PluginInterface.php</exclude-pattern>
51dd8af038SAndreas Gohr        <exclude-pattern>*/inc/PluginTrait.php</exclude-pattern>
52e79ce394SAndreas Gohr
5382f7cb05SAndreas Gohr        <exclude-pattern>*/lib/plugins/*.php</exclude-pattern>
5499c1e5dfSAndreas Gohr        <exclude-pattern>*/lib/plugins/*/action.php</exclude-pattern>
55e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/action/*.php</exclude-pattern>
5699c1e5dfSAndreas Gohr        <exclude-pattern>*/lib/plugins/*/admin.php</exclude-pattern>
57e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/admin/*.php</exclude-pattern>
5899c1e5dfSAndreas Gohr        <exclude-pattern>*/lib/plugins/*/auth.php</exclude-pattern>
59e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/auth/*.php</exclude-pattern>
6099c1e5dfSAndreas Gohr        <exclude-pattern>*/lib/plugins/*/cli.php</exclude-pattern>
61e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/cli/*.php</exclude-pattern>
62e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/helper.php</exclude-pattern>
63e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/helper/*.php</exclude-pattern>
6499c1e5dfSAndreas Gohr        <exclude-pattern>*/lib/plugins/*/remote.php</exclude-pattern>
65e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/remote/*.php</exclude-pattern>
6699c1e5dfSAndreas Gohr        <exclude-pattern>*/lib/plugins/*/syntax.php</exclude-pattern>
67e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/syntax/*.php</exclude-pattern>
6899c1e5dfSAndreas Gohr    </rule>
6982f7cb05SAndreas Gohr
7082f7cb05SAndreas Gohr    <!-- underscore skips exposing public methods to remote api -->
7182f7cb05SAndreas Gohr    <rule ref="PSR2.Methods.MethodDeclaration.Underscore">
721dce0478SAndreas Gohr        <exclude-pattern>*/inc/Extension/RemotePlugin.php</exclude-pattern>
7382f7cb05SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/remote.php</exclude-pattern>
7482f7cb05SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/remote/*.php</exclude-pattern>
7582f7cb05SAndreas Gohr    </rule>
7682f7cb05SAndreas Gohr
7799c1e5dfSAndreas Gohr    <rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
781dce0478SAndreas Gohr        <exclude-pattern>*/inc/Extension/PluginInterface.php</exclude-pattern>
791dce0478SAndreas Gohr        <exclude-pattern>*/inc/Extension/PluginTrait.php</exclude-pattern>
801dce0478SAndreas Gohr
8199c1e5dfSAndreas Gohr        <exclude-pattern>*/inc/parser/*</exclude-pattern>
8299c1e5dfSAndreas Gohr    </rule>
8399c1e5dfSAndreas Gohr
841a953a5bSAndreas Gohr    <!-- for now we mix declarations and execution here FIXME -->
852b2d0ba9SAndreas Gohr    <rule ref="PSR1.Files.SideEffects">
861a953a5bSAndreas Gohr        <exclude-pattern>*/doku.php</exclude-pattern>
871a953a5bSAndreas Gohr        <exclude-pattern>*/install.php</exclude-pattern>
881a953a5bSAndreas Gohr        <exclude-pattern>*/feed.php</exclude-pattern>
89*f4251554SAndreas Gohr        <exclude-pattern>*/inc/load.php</exclude-pattern>
902b2d0ba9SAndreas Gohr        <exclude-pattern>*/bin/*.php</exclude-pattern>
91b78f68bcSAndreas Gohr        <exclude-pattern>*/lib/exe/*.php</exclude-pattern>
922b2d0ba9SAndreas Gohr    </rule>
932b2d0ba9SAndreas Gohr
94994e9d4eSAndreas Gohr</ruleset>
95