1*d5ef99ddSAndreas Gohr<?xml version="1.0"?> 2*d5ef99ddSAndreas Gohr<ruleset name="device-detector"> 3*d5ef99ddSAndreas Gohr <description>Device Detector Coding Standard</description> 4*d5ef99ddSAndreas Gohr 5*d5ef99ddSAndreas Gohr <file>.</file> 6*d5ef99ddSAndreas Gohr 7*d5ef99ddSAndreas Gohr <exclude-pattern>vendor/</exclude-pattern> 8*d5ef99ddSAndreas Gohr 9*d5ef99ddSAndreas Gohr <!-- use MO4 coding standard as base --> 10*d5ef99ddSAndreas Gohr <rule ref="MO4"> 11*d5ef99ddSAndreas Gohr <exclude name="SlevomatCodingStandard.Classes.ForbiddenPublicProperty.ForbiddenPublicProperty"/> 12*d5ef99ddSAndreas Gohr <exclude name="SlevomatCodingStandard.Commenting.UselessInheritDocComment"/> 13*d5ef99ddSAndreas Gohr <exclude name="SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter"/> 14*d5ef99ddSAndreas Gohr <exclude name="Squiz.PHP.DisallowMultipleAssignments.Found"/> 15*d5ef99ddSAndreas Gohr <exclude name="SlevomatCodingStandard.ControlStructures.RequireTernaryOperator"/> 16*d5ef99ddSAndreas Gohr </rule> 17*d5ef99ddSAndreas Gohr 18*d5ef99ddSAndreas Gohr <rule ref="SlevomatCodingStandard.ControlStructures.RequireTernaryOperator"> 19*d5ef99ddSAndreas Gohr <properties> 20*d5ef99ddSAndreas Gohr <property name="ignoreMultiLine" value="true"/> 21*d5ef99ddSAndreas Gohr </properties> 22*d5ef99ddSAndreas Gohr </rule> 23*d5ef99ddSAndreas Gohr 24*d5ef99ddSAndreas Gohr <rule ref="Symfony.Commenting"> 25*d5ef99ddSAndreas Gohr <exclude-pattern>misc/</exclude-pattern> 26*d5ef99ddSAndreas Gohr <exclude-pattern>Tests/</exclude-pattern> 27*d5ef99ddSAndreas Gohr </rule> 28*d5ef99ddSAndreas Gohr 29*d5ef99ddSAndreas Gohr <rule ref="Squiz.Functions.GlobalFunction.Found"> 30*d5ef99ddSAndreas Gohr <exclude-pattern>misc/</exclude-pattern> 31*d5ef99ddSAndreas Gohr <exclude-pattern>autoload.php</exclude-pattern> 32*d5ef99ddSAndreas Gohr </rule> 33*d5ef99ddSAndreas Gohr 34*d5ef99ddSAndreas Gohr <rule ref="PSR1.Files.SideEffects.FoundWithSymbols"> 35*d5ef99ddSAndreas Gohr <exclude-pattern>misc/</exclude-pattern> 36*d5ef99ddSAndreas Gohr <exclude-pattern>autoload.php</exclude-pattern> 37*d5ef99ddSAndreas Gohr </rule> 38*d5ef99ddSAndreas Gohr 39*d5ef99ddSAndreas Gohr <!-- Disallow more than 120 chars per line --> 40*d5ef99ddSAndreas Gohr <rule ref="Generic.Files.LineLength"> 41*d5ef99ddSAndreas Gohr <properties> 42*d5ef99ddSAndreas Gohr <property name="lineLimit" value="120" /> 43*d5ef99ddSAndreas Gohr <property name="absoluteLineLimit" value="120" /> 44*d5ef99ddSAndreas Gohr </properties> 45*d5ef99ddSAndreas Gohr <exclude-pattern>misc/</exclude-pattern> 46*d5ef99ddSAndreas Gohr <exclude-pattern>Tests/</exclude-pattern> 47*d5ef99ddSAndreas Gohr </rule> 48*d5ef99ddSAndreas Gohr 49*d5ef99ddSAndreas Gohr <!-- Require spaces around string concatenating --> 50*d5ef99ddSAndreas Gohr <rule ref="Squiz.Strings.ConcatenationSpacing"> 51*d5ef99ddSAndreas Gohr <properties> 52*d5ef99ddSAndreas Gohr <property name="spacing" value="1" /> 53*d5ef99ddSAndreas Gohr </properties> 54*d5ef99ddSAndreas Gohr </rule> 55*d5ef99ddSAndreas Gohr 56*d5ef99ddSAndreas Gohr <!-- Disallow is_null function --> 57*d5ef99ddSAndreas Gohr <rule ref="Generic.PHP.ForbiddenFunctions"> 58*d5ef99ddSAndreas Gohr <properties> 59*d5ef99ddSAndreas Gohr <property name="forbiddenFunctions" type="array" value="is_null=>null"/> 60*d5ef99ddSAndreas Gohr </properties> 61*d5ef99ddSAndreas Gohr </rule> 62*d5ef99ddSAndreas Gohr 63*d5ef99ddSAndreas Gohr <!-- Require empty lines around control structures --> 64*d5ef99ddSAndreas Gohr <rule ref="SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing"/> 65*d5ef99ddSAndreas Gohr 66*d5ef99ddSAndreas Gohr <!-- Require strict types --> 67*d5ef99ddSAndreas Gohr <rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes"> 68*d5ef99ddSAndreas Gohr <properties> 69*d5ef99ddSAndreas Gohr <property name="linesCountBeforeDeclare" value="1" /> 70*d5ef99ddSAndreas Gohr <property name="spacesCountAroundEqualsSign" value="0" /> 71*d5ef99ddSAndreas Gohr <property name="linesCountAfterDeclare" value="1" /> 72*d5ef99ddSAndreas Gohr </properties> 73*d5ef99ddSAndreas Gohr </rule> 74*d5ef99ddSAndreas Gohr 75*d5ef99ddSAndreas Gohr <!-- Require Yoda-Conditions --> 76*d5ef99ddSAndreas Gohr <rule ref="SlevomatCodingStandard.ControlStructures.RequireYodaComparison"/> 77*d5ef99ddSAndreas Gohr 78*d5ef99ddSAndreas Gohr <!-- Disallow useless semicolons --> 79*d5ef99ddSAndreas Gohr <rule ref="SlevomatCodingStandard.PHP.UselessSemicolon" /> 80*d5ef99ddSAndreas Gohr 81*d5ef99ddSAndreas Gohr <!-- Disallow old type hints in comments (e.g. "int[]" should be "array<int>") --> 82*d5ef99ddSAndreas Gohr <rule ref="SlevomatCodingStandard.TypeHints.DisallowArrayTypeHintSyntax"/> 83*d5ef99ddSAndreas Gohr 84*d5ef99ddSAndreas Gohr <!-- Disallow spaces after splat operator --> 85*d5ef99ddSAndreas Gohr <rule ref="SlevomatCodingStandard.Operators.SpreadOperatorSpacing"/> 86*d5ef99ddSAndreas Gohr 87*d5ef99ddSAndreas Gohr <!-- Disallow empty lines around class braces --> 88*d5ef99ddSAndreas Gohr <rule ref="SlevomatCodingStandard.Classes.EmptyLinesAroundClassBraces"> 89*d5ef99ddSAndreas Gohr <properties> 90*d5ef99ddSAndreas Gohr <property name="linesCountAfterOpeningBrace" value="0" /> 91*d5ef99ddSAndreas Gohr <property name="linesCountBeforeClosingBrace" value="0" /> 92*d5ef99ddSAndreas Gohr </properties> 93*d5ef99ddSAndreas Gohr </rule> 94*d5ef99ddSAndreas Gohr 95*d5ef99ddSAndreas Gohr <!-- Require empty lines around namespace definition --> 96*d5ef99ddSAndreas Gohr <rule ref="SlevomatCodingStandard.Namespaces.NamespaceSpacing"> 97*d5ef99ddSAndreas Gohr <properties> 98*d5ef99ddSAndreas Gohr <property name="linesCountBeforeNamespace" value="1" /> 99*d5ef99ddSAndreas Gohr <property name="linesCountAfterNamespace" value="1" /> 100*d5ef99ddSAndreas Gohr </properties> 101*d5ef99ddSAndreas Gohr </rule> 102*d5ef99ddSAndreas Gohr 103*d5ef99ddSAndreas Gohr <!-- Require empty lines around use statements --> 104*d5ef99ddSAndreas Gohr <rule ref="SlevomatCodingStandard.Namespaces.UseSpacing"> 105*d5ef99ddSAndreas Gohr <properties> 106*d5ef99ddSAndreas Gohr <property name="linesCountBeforeFirstUse" value="1" /> 107*d5ef99ddSAndreas Gohr <property name="linesCountBetweenUseTypes" value="0" /> 108*d5ef99ddSAndreas Gohr <property name="linesCountAfterLastUse" value="1" /> 109*d5ef99ddSAndreas Gohr </properties> 110*d5ef99ddSAndreas Gohr </rule> 111*d5ef99ddSAndreas Gohr</ruleset> 112