xref: /dokuwiki/_test/phpcs.xml (revision 95078f236f25cbd6aa6d3e5aae7a3f3d39de6834)
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/JpegMeta.php</exclude-pattern>
2909d57d5aSAndreas Gohr    <exclude-pattern>*/lib/plugins/authad/adLDAP</exclude-pattern>
3099c1e5dfSAndreas Gohr
31dd8af038SAndreas Gohr    <!-- deprecated files to be removed soon -->
32*95078f23SAndreas Gohr    <exclude-pattern>*/inc/parser/parser.php</exclude-pattern>
33dd8af038SAndreas Gohr
3436faf696SMichael Große    <!-- rules on top of PSR-12 -->
35903d43feSMichael Große    <rule ref="PSR12">
3636faf696SMichael Große        <!-- This rule breaks the single line guard pattern that we prefer to keep using -->
37994e9d4eSAndreas Gohr        <exclude name="Generic.ControlStructures.InlineControlStructure.NotAllowed"/>
384b3d1701SAndreas Gohr
394b3d1701SAndreas Gohr        <!-- we have lots of legacy classes without name spaces -->
404b3d1701SAndreas Gohr        <exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace"/>
41994e9d4eSAndreas Gohr    </rule>
4299c1e5dfSAndreas Gohr
4399c1e5dfSAndreas Gohr    <!-- disable some rules for certain paths, for legacy support -->
4499c1e5dfSAndreas Gohr    <rule ref="Squiz.Classes.ValidClassName.NotCamelCaps">
4599c1e5dfSAndreas Gohr        <exclude-pattern>*/inc/Plugin.php</exclude-pattern>
4699c1e5dfSAndreas Gohr        <exclude-pattern>*/inc/PluginInterface.php</exclude-pattern>
47dd8af038SAndreas Gohr        <exclude-pattern>*/inc/PluginTrait.php</exclude-pattern>
48e79ce394SAndreas Gohr
4982f7cb05SAndreas Gohr        <exclude-pattern>*/lib/plugins/*.php</exclude-pattern>
5099c1e5dfSAndreas Gohr        <exclude-pattern>*/lib/plugins/*/action.php</exclude-pattern>
51e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/action/*.php</exclude-pattern>
5299c1e5dfSAndreas Gohr        <exclude-pattern>*/lib/plugins/*/admin.php</exclude-pattern>
53e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/admin/*.php</exclude-pattern>
5499c1e5dfSAndreas Gohr        <exclude-pattern>*/lib/plugins/*/auth.php</exclude-pattern>
55e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/auth/*.php</exclude-pattern>
5699c1e5dfSAndreas Gohr        <exclude-pattern>*/lib/plugins/*/cli.php</exclude-pattern>
57e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/cli/*.php</exclude-pattern>
58e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/helper.php</exclude-pattern>
59e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/helper/*.php</exclude-pattern>
6099c1e5dfSAndreas Gohr        <exclude-pattern>*/lib/plugins/*/remote.php</exclude-pattern>
61e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/remote/*.php</exclude-pattern>
6299c1e5dfSAndreas Gohr        <exclude-pattern>*/lib/plugins/*/syntax.php</exclude-pattern>
63e79ce394SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/syntax/*.php</exclude-pattern>
64*95078f23SAndreas Gohr
65*95078f23SAndreas Gohr        <exclude-pattern>*/inc/parser/*</exclude-pattern>
6699c1e5dfSAndreas Gohr    </rule>
6782f7cb05SAndreas Gohr
6882f7cb05SAndreas Gohr    <!-- underscore skips exposing public methods to remote api -->
6982f7cb05SAndreas Gohr    <rule ref="PSR2.Methods.MethodDeclaration.Underscore">
701dce0478SAndreas Gohr        <exclude-pattern>*/inc/Extension/RemotePlugin.php</exclude-pattern>
7182f7cb05SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/remote.php</exclude-pattern>
7282f7cb05SAndreas Gohr        <exclude-pattern>*/lib/plugins/*/remote/*.php</exclude-pattern>
73*95078f23SAndreas Gohr
74*95078f23SAndreas Gohr        <exclude-pattern>*/inc/parser/*</exclude-pattern>
75*95078f23SAndreas Gohr    </rule>
76*95078f23SAndreas Gohr
77*95078f23SAndreas Gohr    <rule ref="PSR2.Classes.PropertyDeclaration.Underscore">
78*95078f23SAndreas Gohr        <exclude-pattern>*/inc/parser/*</exclude-pattern>
7982f7cb05SAndreas Gohr    </rule>
8082f7cb05SAndreas Gohr
8199c1e5dfSAndreas Gohr    <rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
821dce0478SAndreas Gohr        <exclude-pattern>*/inc/Extension/PluginInterface.php</exclude-pattern>
831dce0478SAndreas Gohr        <exclude-pattern>*/inc/Extension/PluginTrait.php</exclude-pattern>
84*95078f23SAndreas Gohr
85*95078f23SAndreas Gohr        <exclude-pattern>*/inc/parser/*</exclude-pattern>
8699c1e5dfSAndreas Gohr    </rule>
87994e9d4eSAndreas Gohr</ruleset>
88