xref: /dokuwiki/_test/phpcs.xml (revision b78f68bc5708b0979539d0c69e2bd75e33d3cd28)
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
1099c1e5dfSAndreas Gohr    <!-- where to look -->
11994e9d4eSAndreas Gohr    <file>../inc</file>
12994e9d4eSAndreas Gohr    <file>../lib</file>
13994e9d4eSAndreas Gohr    <file>../bin</file>
14994e9d4eSAndreas Gohr    <file>../doku.php</file>
15994e9d4eSAndreas Gohr    <file>../index.php</file>
16994e9d4eSAndreas Gohr    <file>../feed.php</file>
17994e9d4eSAndreas Gohr    <file>../install.php</file>
1899c1e5dfSAndreas Gohr
1999c1e5dfSAndreas Gohr    <!-- skip these completely -->
20994e9d4eSAndreas Gohr    <exclude-pattern>*/lang/*/lang.php</exclude-pattern>
21994e9d4eSAndreas Gohr    <exclude-pattern>*/lang/*/settings.php</exclude-pattern>
22994e9d4eSAndreas Gohr    <exclude-pattern>*/_test/*</exclude-pattern>
2399c1e5dfSAndreas Gohr
2499c1e5dfSAndreas Gohr    <!-- 3rd party libs, these should be moved to composer some day -->
2599c1e5dfSAndreas Gohr    <exclude-pattern>*/inc/DifferenceEngine.php</exclude-pattern>
2699c1e5dfSAndreas Gohr    <exclude-pattern>*/inc/IXR_Library.php</exclude-pattern>
2799c1e5dfSAndreas Gohr    <exclude-pattern>*/inc/JSON.php</exclude-pattern>
2899c1e5dfSAndreas Gohr    <exclude-pattern>*/inc/JpegMeta.php</exclude-pattern>
2909d57d5aSAndreas Gohr    <exclude-pattern>*/lib/plugins/authad/adLDAP</exclude-pattern>
3099c1e5dfSAndreas Gohr
31994e9d4eSAndreas Gohr    <!-- rules on top of PSR-2 -->
32994e9d4eSAndreas Gohr    <rule ref="PSR2">
33994e9d4eSAndreas Gohr        <!-- the following rule is not in PSR-2 and breaks the guardian pattern -->
34994e9d4eSAndreas Gohr        <exclude name="Generic.ControlStructures.InlineControlStructure.NotAllowed"/>
354b3d1701SAndreas Gohr
364b3d1701SAndreas Gohr        <!-- we have lots of legacy classes without name spaces -->
374b3d1701SAndreas Gohr        <exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace"/>
38994e9d4eSAndreas Gohr    </rule>
3999c1e5dfSAndreas Gohr
4099c1e5dfSAndreas Gohr    <!-- disable some rules for certain paths, for legacy support -->
4199c1e5dfSAndreas Gohr    <rule ref="Squiz.Classes.ValidClassName.NotCamelCaps">
4299c1e5dfSAndreas Gohr        <exclude-pattern>*/inc/parser/*</exclude-pattern>
4399c1e5dfSAndreas Gohr
4499c1e5dfSAndreas Gohr        <exclude-pattern>*/inc/Plugin.php</exclude-pattern>
4599c1e5dfSAndreas Gohr        <exclude-pattern>*/inc/PluginInterface.php</exclude-pattern>
46e79ce394SAndreas Gohr
4782f7cb05SAndreas Gohr        <exclude-pattern>*/lib/plugins/*.php</exclude-pattern>
4899c1e5dfSAndreas Gohr        <exclude-pattern>*/lib/plugins/*/action.php</exclude-pattern>
49e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/action/*.php</exclude-pattern>
5099c1e5dfSAndreas Gohr        <exclude-pattern>*/lib/plugins/*/admin.php</exclude-pattern>
51e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/admin/*.php</exclude-pattern>
5299c1e5dfSAndreas Gohr        <exclude-pattern>*/lib/plugins/*/auth.php</exclude-pattern>
53e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/auth/*.php</exclude-pattern>
5499c1e5dfSAndreas Gohr        <exclude-pattern>*/lib/plugins/*/cli.php</exclude-pattern>
55e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/cli/*.php</exclude-pattern>
56e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/helper.php</exclude-pattern>
57e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/helper/*.php</exclude-pattern>
5899c1e5dfSAndreas Gohr        <exclude-pattern>*/lib/plugins/*/remote.php</exclude-pattern>
59e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/remote/*.php</exclude-pattern>
6099c1e5dfSAndreas Gohr        <exclude-pattern>*/lib/plugins/*/syntax.php</exclude-pattern>
61e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/syntax/*.php</exclude-pattern>
6299c1e5dfSAndreas Gohr    </rule>
6382f7cb05SAndreas Gohr
6482f7cb05SAndreas Gohr    <!-- underscore skips exposing public methods to remote api -->
6582f7cb05SAndreas Gohr    <rule ref="PSR2.Methods.MethodDeclaration.Underscore">
6682f7cb05SAndreas Gohr        <exclude-pattern>*/lib/plugins/remote.php</exclude-pattern>
6782f7cb05SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/remote.php</exclude-pattern>
6882f7cb05SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/remote/*.php</exclude-pattern>
6982f7cb05SAndreas Gohr    </rule>
7082f7cb05SAndreas Gohr
7199c1e5dfSAndreas Gohr    <rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
7299c1e5dfSAndreas Gohr        <exclude-pattern>*/inc/parser/*</exclude-pattern>
7399c1e5dfSAndreas Gohr    </rule>
7499c1e5dfSAndreas Gohr
751a953a5bSAndreas Gohr    <!-- for now we mix declarations and execution here FIXME -->
762b2d0ba9SAndreas Gohr    <rule ref="PSR1.Files.SideEffects">
771a953a5bSAndreas Gohr        <exclude-pattern>*/doku.php</exclude-pattern>
781a953a5bSAndreas Gohr        <exclude-pattern>*/install.php</exclude-pattern>
791a953a5bSAndreas Gohr        <exclude-pattern>*/feed.php</exclude-pattern>
802b2d0ba9SAndreas Gohr        <exclude-pattern>*/bin/*.php</exclude-pattern>
81*b78f68bcSAndreas Gohr        <exclude-pattern>*/lib/exe/*.php</exclude-pattern>
822b2d0ba9SAndreas Gohr    </rule>
832b2d0ba9SAndreas Gohr
84994e9d4eSAndreas Gohr</ruleset>
85