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