|
| 1 | +<?xml version="1.0"?> |
| 2 | +<ruleset> |
| 3 | + <arg name="basepath" value="." /> |
| 4 | + <arg name="extensions" value="php" /> |
| 5 | + <arg name="parallel" value="80" /> |
| 6 | + <arg name="cache" value=".phpcs-cache" /> |
| 7 | + <arg name="colors" /> |
| 8 | + |
| 9 | + <!-- Ignore warnings (n), show progress of the run (p), and show sniff names (s) --> |
| 10 | + <arg value="nps"/> |
| 11 | + |
| 12 | + <file>src</file> |
| 13 | + <file>tests</file> |
| 14 | + |
| 15 | + <!-- Target minimum supported PHP version --> |
| 16 | + <config name="php_version" value="801000"/> |
| 17 | + |
| 18 | + <!-- ****************************************** --> |
| 19 | + <!-- Import rules from doctrine/coding-standard --> |
| 20 | + <!-- ****************************************** --> |
| 21 | + <rule ref="Doctrine"> |
| 22 | + </rule> |
| 23 | + |
| 24 | + |
| 25 | + <!-- **************************************** --> |
| 26 | + <!-- Enable rules not enforced by Doctrine CS --> |
| 27 | + <!-- **************************************** --> |
| 28 | + |
| 29 | + <!-- Require arrow functions where possible --> |
| 30 | + <rule ref="SlevomatCodingStandard.Functions.RequireArrowFunction"/> |
| 31 | + <!-- Forbid fully qualified names even for colliding names --> |
| 32 | + <rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly"> |
| 33 | + <properties> |
| 34 | + <property name="allowFallbackGlobalConstants" value="false"/> |
| 35 | + <property name="allowFallbackGlobalFunctions" value="false"/> |
| 36 | + <property name="allowFullyQualifiedGlobalClasses" value="false"/> |
| 37 | + <property name="allowFullyQualifiedGlobalConstants" value="false"/> |
| 38 | + <property name="allowFullyQualifiedGlobalFunctions" value="false"/> |
| 39 | + <property phpcs-only="true" name="allowFullyQualifiedNameForCollidingClasses" value="false"/> |
| 40 | + <property phpcs-only="true" name="allowFullyQualifiedNameForCollidingConstants" value="false"/> |
| 41 | + <property phpcs-only="true" name="allowFullyQualifiedNameForCollidingFunctions" value="false"/> |
| 42 | + <property name="searchAnnotations" value="true"/> |
| 43 | + </properties> |
| 44 | + </rule> |
| 45 | + |
| 46 | + |
| 47 | + <!-- ****************************************************** --> |
| 48 | + <!-- Don't require annotations to specify traversable types --> |
| 49 | + <!-- ****************************************************** --> |
| 50 | + <rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint"> |
| 51 | + <exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification" /> |
| 52 | + </rule> |
| 53 | + <rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint"> |
| 54 | + <exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingTraversableTypeHintSpecification" /> |
| 55 | + </rule> |
| 56 | + <rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint"> |
| 57 | + <exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification" /> |
| 58 | + </rule> |
| 59 | + |
| 60 | + |
| 61 | + <!-- ************************************************************************** --> |
| 62 | + <!-- Require type hints for all parameters, properties, and return types in src --> |
| 63 | + <!-- ************************************************************************** --> |
| 64 | + <rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingAnyTypeHint"> |
| 65 | + <exclude-pattern>tests</exclude-pattern> |
| 66 | + </rule> |
| 67 | + <rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingAnyTypeHint"> |
| 68 | + <exclude-pattern>tests</exclude-pattern> |
| 69 | + </rule> |
| 70 | + <rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingAnyTypeHint"> |
| 71 | + <exclude-pattern>tests</exclude-pattern> |
| 72 | + </rule> |
| 73 | + |
| 74 | + |
| 75 | + <!-- *********************************************************** --> |
| 76 | + <!-- Require native type hints for all code without a BC promise --> |
| 77 | + <!-- *********************************************************** --> |
| 78 | + <rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint"> |
| 79 | + </rule> |
| 80 | + |
| 81 | + |
| 82 | + <!-- ************************************************************* --> |
| 83 | + <!-- Ignore errors for certain files where this is part of the API --> |
| 84 | + <!-- ************************************************************* --> |
| 85 | + <rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps"> |
| 86 | + </rule> |
| 87 | + <rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses"> |
| 88 | + </rule> |
| 89 | + <rule ref="Squiz.Classes.ClassFileName.NoMatch"> |
| 90 | + </rule> |
| 91 | + <rule ref="Squiz.Classes.ValidClassName.NotCamelCaps"> |
| 92 | + </rule> |
| 93 | +</ruleset> |
0 commit comments