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 10*b196d8deSAndreas Gohr <ini name="memory_limit" value="-1" /> 11*b196d8deSAndreas 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 33994e9d4eSAndreas Gohr <!-- rules on top of PSR-2 --> 34994e9d4eSAndreas Gohr <rule ref="PSR2"> 35994e9d4eSAndreas Gohr <!-- the following rule is not in PSR-2 and breaks the guardian pattern --> 36994e9d4eSAndreas Gohr <exclude name="Generic.ControlStructures.InlineControlStructure.NotAllowed"/> 374b3d1701SAndreas Gohr 384b3d1701SAndreas Gohr <!-- we have lots of legacy classes without name spaces --> 394b3d1701SAndreas Gohr <exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace"/> 40994e9d4eSAndreas Gohr </rule> 4199c1e5dfSAndreas Gohr 4299c1e5dfSAndreas Gohr <!-- disable some rules for certain paths, for legacy support --> 4399c1e5dfSAndreas Gohr <rule ref="Squiz.Classes.ValidClassName.NotCamelCaps"> 4499c1e5dfSAndreas Gohr <exclude-pattern>*/inc/parser/*</exclude-pattern> 4599c1e5dfSAndreas Gohr 4699c1e5dfSAndreas Gohr <exclude-pattern>*/inc/Plugin.php</exclude-pattern> 4799c1e5dfSAndreas Gohr <exclude-pattern>*/inc/PluginInterface.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> 6499c1e5dfSAndreas Gohr </rule> 6582f7cb05SAndreas Gohr 6682f7cb05SAndreas Gohr <!-- underscore skips exposing public methods to remote api --> 6782f7cb05SAndreas Gohr <rule ref="PSR2.Methods.MethodDeclaration.Underscore"> 6882f7cb05SAndreas Gohr <exclude-pattern>*/lib/plugins/remote.php</exclude-pattern> 6982f7cb05SAndreas Gohr <exclude-pattern>*/lib/plugins/*/remote.php</exclude-pattern> 7082f7cb05SAndreas Gohr <exclude-pattern>*/lib/plugins/*/remote/*.php</exclude-pattern> 7182f7cb05SAndreas Gohr </rule> 7282f7cb05SAndreas Gohr 7399c1e5dfSAndreas Gohr <rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps"> 7499c1e5dfSAndreas Gohr <exclude-pattern>*/inc/parser/*</exclude-pattern> 7599c1e5dfSAndreas Gohr </rule> 7699c1e5dfSAndreas Gohr 771a953a5bSAndreas Gohr <!-- for now we mix declarations and execution here FIXME --> 782b2d0ba9SAndreas Gohr <rule ref="PSR1.Files.SideEffects"> 791a953a5bSAndreas Gohr <exclude-pattern>*/doku.php</exclude-pattern> 801a953a5bSAndreas Gohr <exclude-pattern>*/install.php</exclude-pattern> 811a953a5bSAndreas Gohr <exclude-pattern>*/feed.php</exclude-pattern> 822b2d0ba9SAndreas Gohr <exclude-pattern>*/bin/*.php</exclude-pattern> 83b78f68bcSAndreas Gohr <exclude-pattern>*/lib/exe/*.php</exclude-pattern> 842b2d0ba9SAndreas Gohr </rule> 852b2d0ba9SAndreas Gohr 86994e9d4eSAndreas Gohr</ruleset> 87