|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 3 | + name="Coding Standard" |
| 4 | + xsi:noNamespaceSchemaLocation="./vendor/squizlabs/php_codesniffer/phpcs.xsd"> |
| 5 | + |
| 6 | + <arg value="sp"/> |
| 7 | + <config name="tab_width" value="4"/> |
| 8 | + |
| 9 | + <rule ref="PSR12"/> |
| 10 | + <rule ref="PSR12.Namespaces.CompoundNamespaceDepth"> |
| 11 | + <properties> |
| 12 | + <property name="maxDepth" value="0"/> |
| 13 | + </properties> |
| 14 | + </rule> |
| 15 | + <rule ref="PSR12.ControlStructures.BooleanOperatorPlacement"> |
| 16 | + <properties> |
| 17 | + <property name="allowOnly" value="first"/> |
| 18 | + </properties> |
| 19 | + </rule> |
| 20 | + <rule ref="Generic.Arrays.ArrayIndent"/> |
| 21 | + <rule ref="Generic.Arrays.DisallowLongArraySyntax"/> |
| 22 | + <rule ref="Generic.Files.LineLength"> |
| 23 | + <properties> |
| 24 | + <property name="ignoreComments" value="true"/> |
| 25 | + </properties> |
| 26 | + </rule> |
| 27 | + <rule ref="Generic.Formatting.SpaceAfterCast"/> |
| 28 | + <rule ref="Generic.Formatting.SpaceAfterNot"> |
| 29 | + <properties> |
| 30 | + <property name="spacing" value="0"/> |
| 31 | + </properties> |
| 32 | + </rule> |
| 33 | + <rule ref="SlevomatCodingStandard.Arrays.TrailingArrayComma"/> |
| 34 | + <rule ref="SlevomatCodingStandard.Attributes.DisallowAttributesJoining"/> |
| 35 | + <rule ref="SlevomatCodingStandard.Attributes.DisallowMultipleAttributesPerLine"/> |
| 36 | + <rule ref="SlevomatCodingStandard.Classes.BackedEnumTypeSpacing"/> |
| 37 | + <rule ref="SlevomatCodingStandard.Classes.ClassMemberSpacing"> |
| 38 | + <properties> |
| 39 | + <property name="linesCountBetweenMembers" value="1"/> |
| 40 | + </properties> |
| 41 | + </rule> |
| 42 | + <rule ref="SlevomatCodingStandard.Classes.ClassStructure"> |
| 43 | + <properties> |
| 44 | + <property name="groups" type="array"> |
| 45 | + <element value="uses"/> |
| 46 | + <element value="constants"/> |
| 47 | + <element value="enum cases"/> |
| 48 | + <element value="properties"/> |
| 49 | + <element value="constructor"/> |
| 50 | + <element value="methods"/> |
| 51 | + </property> |
| 52 | + </properties> |
| 53 | + </rule> |
| 54 | + <rule ref="SlevomatCodingStandard.Classes.MethodSpacing"> |
| 55 | + <properties> |
| 56 | + <property name="minLinesCount" value="1"/> |
| 57 | + <property name="maxLinesCount" value="1"/> |
| 58 | + </properties> |
| 59 | + </rule> |
| 60 | + <rule ref="SlevomatCodingStandard.Classes.RequireAbstractOrFinal"/> |
| 61 | + <rule ref="SlevomatCodingStandard.Classes.SuperfluousTraitNaming"/> |
| 62 | + <rule ref="SlevomatCodingStandard.Commenting.DocCommentSpacing"> |
| 63 | + <properties> |
| 64 | + <property name="linesCountBeforeFirstContent" value="0"/> |
| 65 | + <property name="linesCountBetweenDescriptionAndAnnotations" value="1"/> |
| 66 | + <property name="linesCountBetweenDifferentAnnotationsTypes" value="0"/> |
| 67 | + <property name="linesCountAfterLastContent" value="0"/> |
| 68 | + </properties> |
| 69 | + </rule> |
| 70 | + <rule ref="SlevomatCodingStandard.Commenting.UselessFunctionDocComment"/> |
| 71 | + <rule ref="SlevomatCodingStandard.Commenting.UselessInheritDocComment"/> |
| 72 | + <rule ref="SlevomatCodingStandard.ControlStructures.DisallowYodaComparison"/> |
| 73 | + <rule ref="SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing"> |
| 74 | + <properties> |
| 75 | + <property name="linesCountBefore" value="1"/> |
| 76 | + <property name="linesCountAfter" value="1"/> |
| 77 | + <property name="controlStructures" type="array"> |
| 78 | + <element value="for"/> |
| 79 | + <element value="foreach"/> |
| 80 | + <element value="if"/> |
| 81 | + <element value="switch"/> |
| 82 | + <element value="while"/> |
| 83 | + </property> |
| 84 | + </properties> |
| 85 | + </rule> |
| 86 | + <rule ref="SlevomatCodingStandard.ControlStructures.JumpStatementsSpacing"> |
| 87 | + <properties> |
| 88 | + <property name="linesCountBefore" value="1"/> |
| 89 | + <property name="jumpStatements" type="array"> |
| 90 | + <element value="break"/> |
| 91 | + <element value="continue"/> |
| 92 | + <element value="yield"/> |
| 93 | + <element value="yield_from"/> |
| 94 | + <element value="return"/> |
| 95 | + <element value="throw"/> |
| 96 | + </property> |
| 97 | + </properties> |
| 98 | + </rule> |
| 99 | + <rule ref="SlevomatCodingStandard.ControlStructures.UselessTernaryOperator"/> |
| 100 | + <rule ref="SlevomatCodingStandard.Exceptions.RequireNonCapturingCatch"/> |
| 101 | + <rule ref="SlevomatCodingStandard.Functions.ArrowFunctionDeclaration"> |
| 102 | + <properties> |
| 103 | + <property name="spacesCountAfterKeyword" value="1"/> |
| 104 | + <property name="spacesCountBeforeArrow" value="1"/> |
| 105 | + <property name="spacesCountAfterArrow" value="1"/> |
| 106 | + </properties> |
| 107 | + </rule> |
| 108 | + <rule ref="SlevomatCodingStandard.Functions.NamedArgumentSpacing"/> |
| 109 | + <rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInCall"/> |
| 110 | + <rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInDeclaration"/> |
| 111 | + <rule ref="SlevomatCodingStandard.Functions.StaticClosure"/> |
| 112 | + <rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses"/> |
| 113 | + <rule ref="SlevomatCodingStandard.Namespaces.UnusedUses"/> |
| 114 | + <rule ref="SlevomatCodingStandard.Namespaces.UselessAlias"/> |
| 115 | + <rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation"/> |
| 116 | + <rule ref="SlevomatCodingStandard.Operators.NegationOperatorSpacing"> |
| 117 | + <properties> |
| 118 | + <property name="spacesCount" value="0"/> |
| 119 | + </properties> |
| 120 | + </rule> |
| 121 | + <rule ref="SlevomatCodingStandard.Operators.SpreadOperatorSpacing"> |
| 122 | + <properties> |
| 123 | + <property name="spacesCountAfterOperator" value="0"/> |
| 124 | + </properties> |
| 125 | + </rule> |
| 126 | + <rule ref="SlevomatCodingStandard.PHP.ShortList"/> |
| 127 | + <rule ref="SlevomatCodingStandard.PHP.TypeCast"/> |
| 128 | + <rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes"> |
| 129 | + <properties> |
| 130 | + <property name="spacesCountAroundEqualsSign" value="0"/> |
| 131 | + </properties> |
| 132 | + </rule> |
| 133 | + <rule ref="SlevomatCodingStandard.TypeHints.DNFTypeHintFormat"> |
| 134 | + <properties> |
| 135 | + <property name="withSpacesAroundOperators" value="no"/> |
| 136 | + <property name="withSpacesInsideParentheses" value="no"/> |
| 137 | + <property name="shortNullable" value="yes"/> |
| 138 | + <property name="nullPosition" value="last"/> |
| 139 | + </properties> |
| 140 | + </rule> |
| 141 | + <rule ref="SlevomatCodingStandard.TypeHints.LongTypeHints"/> |
| 142 | + <rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue"/> |
| 143 | + <rule ref="SlevomatCodingStandard.Whitespaces.DuplicateSpaces"/> |
| 144 | + <rule ref="Squiz.Commenting.FunctionComment"> |
| 145 | + <exclude name="Squiz.Commenting.FunctionComment.EmptyThrows"/> |
| 146 | + <exclude name="Squiz.Commenting.FunctionComment.Missing"/> |
| 147 | + <exclude name="Squiz.Commenting.FunctionComment.MissingParamComment"/> |
| 148 | + <exclude name="Squiz.Commenting.FunctionComment.IncorrectParamVarName"/> |
| 149 | + <exclude name="Squiz.Commenting.FunctionComment.IncorrectTypeHint"/> |
| 150 | + <exclude name="Squiz.Commenting.FunctionComment.InvalidReturn"/> |
| 151 | + <exclude name="Squiz.Commenting.FunctionComment.ParamCommentFullStop"/> |
| 152 | + <exclude name="Squiz.Commenting.FunctionComment.ParamCommentNotCapital"/> |
| 153 | + <exclude name="Squiz.Commenting.FunctionComment.ScalarTypeHintMissing"/> |
| 154 | + <exclude name="Squiz.Commenting.FunctionComment.SpacingAfterParamName"/> |
| 155 | + <exclude name="Squiz.Commenting.FunctionComment.SpacingAfterParamType"/> |
| 156 | + <exclude name="Squiz.Commenting.FunctionComment.TypeHintMissing"/> |
| 157 | + </rule> |
| 158 | + <rule ref="Squiz.Commenting.FunctionComment.MissingParamTag"> |
| 159 | + <exclude-pattern>tests/**/*Test.php</exclude-pattern> |
| 160 | + </rule> |
| 161 | + <rule ref="Squiz.Commenting.FunctionComment.MissingReturn"> |
| 162 | + <exclude-pattern>tests/**/*Test.php</exclude-pattern> |
| 163 | + </rule> |
| 164 | + <rule ref="Squiz.Commenting.InlineComment"> |
| 165 | + <exclude name="Squiz.Commenting.InlineComment.DocBlock"/> |
| 166 | + <exclude name="Squiz.Commenting.InlineComment.Empty"/> |
| 167 | + <exclude name="Squiz.Commenting.InlineComment.InvalidEndChar"/> |
| 168 | + <exclude name="Squiz.Commenting.InlineComment.NotCapital"/> |
| 169 | + </rule> |
| 170 | + <rule ref="Squiz.NamingConventions.ValidVariableName.NotCamelCaps"/> |
| 171 | + <rule ref="Squiz.Strings.DoubleQuoteUsage"/> |
| 172 | + <rule ref="Squiz.Strings.DoubleQuoteUsage.ContainsVar"> |
| 173 | + <severity>0</severity> |
| 174 | + </rule> |
| 175 | + <file>./src</file> |
| 176 | + <file>./tests</file> |
| 177 | +</ruleset> |
0 commit comments