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