|
69 | 69 | <rule ref="PSR2.ControlStructures.ElseIfDeclaration.NotAllowed">
|
70 | 70 | <type>error</type>
|
71 | 71 | </rule>
|
| 72 | + <!-- Require comma after last element in multi-line array --> |
| 73 | + <rule ref="SlevomatCodingStandard.Arrays.TrailingArrayComma"/> |
| 74 | + <!-- Require presence of constant visibility --> |
| 75 | + <rule ref="SlevomatCodingStandard.Classes.ClassConstantVisibility"/> |
| 76 | + <!-- Forbid dead code --> |
| 77 | + <rule ref="SlevomatCodingStandard.Classes.UnusedPrivateElements"/> |
| 78 | + <!-- Forbid useless annotations - Git and LICENCE file provide more accurate information --> |
| 79 | + <rule ref="SlevomatCodingStandard.Commenting.ForbiddenAnnotations"> |
| 80 | + <properties> |
| 81 | + <property |
| 82 | + name="forbiddenAnnotations" |
| 83 | + type="array" |
| 84 | + value=" |
| 85 | + @author, |
| 86 | + @copyright, |
| 87 | + @created, |
| 88 | + @license, |
| 89 | + @package, |
| 90 | + @since, |
| 91 | + @version |
| 92 | + " |
| 93 | + /> |
| 94 | + </properties> |
| 95 | + </rule> |
| 96 | + <!-- report invalid format of inline phpDocs with @var --> |
| 97 | + <rule ref="SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration"/> |
| 98 | + <!-- Forbid assignments in conditions --> |
| 99 | + <rule ref="SlevomatCodingStandard.ControlStructures.AssignmentInCondition"/> |
| 100 | + <!-- Forbid fancy yoda conditions --> |
| 101 | + <rule ref="SlevomatCodingStandard.ControlStructures.DisallowYodaComparison"/> |
| 102 | + <!-- Forbid weak comparisons --> |
| 103 | + <rule ref="SlevomatCodingStandard.ControlStructures.DisallowEqualOperators"/> |
| 104 | + <!-- Require language constructs without parentheses --> |
| 105 | + <rule ref="SlevomatCodingStandard.ControlStructures.LanguageConstructWithParentheses"/> |
| 106 | + <!-- Forbid useless unreachable catch blocks --> |
| 107 | + <rule ref="SlevomatCodingStandard.Exceptions.DeadCatch"/> |
| 108 | + <!-- Require using Throwable instead of Exception --> |
| 109 | + <rule ref="SlevomatCodingStandard.Exceptions.ReferenceThrowableOnly"/> |
| 110 | + <!-- Require use statements to be alphabetically sorted --> |
| 111 | + <rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses"/> |
| 112 | + <!-- Forbid fancy group uses --> |
| 113 | + <rule ref="SlevomatCodingStandard.Namespaces.DisallowGroupUse"/> |
| 114 | + <!-- Forbid multiple use statements on same line --> |
| 115 | + <rule ref="SlevomatCodingStandard.Namespaces.MultipleUsesPerLine"/> |
| 116 | + <!-- Forbid using absolute class name references (except global ones) --> |
| 117 | + <rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly"> |
| 118 | + <properties> |
| 119 | + <property name="allowFullyQualifiedGlobalClasses" type="boolean" value="true"/> |
| 120 | + <property name="allowFullyQualifiedGlobalFunctions" type="boolean" value="true"/> |
| 121 | + <property name="allowFullyQualifiedGlobalConstants" type="boolean" value="true"/> |
| 122 | + <property name="allowFullyQualifiedNameForCollidingClasses" type="boolean" value="true"/> |
| 123 | + </properties> |
| 124 | + </rule> |
| 125 | + <!-- Forbid unused use statements --> |
| 126 | + <rule ref="SlevomatCodingStandard.Namespaces.UnusedUses"> |
| 127 | + <properties> |
| 128 | + <property name="searchAnnotations" type="boolean" value="true"/> |
| 129 | + </properties> |
| 130 | + </rule> |
| 131 | + <!-- Forbid superfluous leading backslash in use statements --> |
| 132 | + <rule ref="SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash"/> |
| 133 | + <!-- Forbid useless uses of the same namespace --> |
| 134 | + <rule ref="SlevomatCodingStandard.Namespaces.UseFromSameNamespace"/> |
| 135 | + <!-- Require presence of declare(strict_types=1) --> |
| 136 | + <rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes"> |
| 137 | + <properties> |
| 138 | + <property |
| 139 | + name="newlinesCountBetweenOpenTagAndDeclare" |
| 140 | + value="2" |
| 141 | + /> |
| 142 | + <property |
| 143 | + name="spacesCountAroundEqualsSign" |
| 144 | + value="0" |
| 145 | + /> |
| 146 | + </properties> |
| 147 | + </rule> |
| 148 | + <!-- Require use of short versions of scalar types (i.e. int instead of integer) --> |
| 149 | + <rule ref="SlevomatCodingStandard.TypeHints.LongTypeHints"/> |
| 150 | + <!-- Require ? when default value is null --> |
| 151 | + <rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue"/> |
| 152 | + <!-- Require one space between typehint and variable, require no space between nullability sign and typehint --> |
| 153 | + <rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing"/> |
| 154 | + <!-- Require space around colon in return types --> |
| 155 | + <rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing"> |
| 156 | + <properties> |
| 157 | + <property name="spacesCountBeforeColon" value="1"/> |
| 158 | + </properties> |
| 159 | + </rule> |
| 160 | + <!-- Require types to be written as natively if possible; |
| 161 | + require iterable types to specify phpDoc with their content; |
| 162 | + forbid useless/duplicated information in phpDoc --> |
| 163 | + <rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration"> |
| 164 | + <properties> |
| 165 | + <property name="enableEachParameterAndReturnInspection" value="true"/> |
| 166 | + <property name="traversableTypeHints" type="array" value="Doctrine\Common\Collections\Collection"/> |
| 167 | + <property |
| 168 | + name="usefulAnnotations" |
| 169 | + type="array" |
| 170 | + value=" |
| 171 | + @dataProvider, |
| 172 | + @deprecated, |
| 173 | + @expectedException, |
| 174 | + @expectedExceptionMessage, |
| 175 | + @expectedExceptionMessageRegExp, |
| 176 | + @expectedExceptionCode, |
| 177 | + @expectedDeprecation, |
| 178 | + @group, |
| 179 | + @internal, |
| 180 | + @link, |
| 181 | + @see, |
| 182 | + @throws |
| 183 | + " |
| 184 | + /> |
| 185 | + </properties> |
| 186 | + </rule> |
| 187 | + <!-- Forbid empty lines around type declarations --> |
| 188 | + <rule ref="SlevomatCodingStandard.Types.EmptyLinesAroundTypeBraces"> |
| 189 | + <properties> |
| 190 | + <property name="linesCountAfterOpeningBrace" value="0"/> |
| 191 | + <property name="linesCountBeforeClosingBrace" value="0"/> |
| 192 | + </properties> |
| 193 | + </rule> |
72 | 194 | <!-- Forbid spaces around square brackets -->
|
73 | 195 | <rule ref="Squiz.Arrays.ArrayBracketSpacing"/>
|
74 | 196 | <!-- Force array declaration structure -->
|
|
0 commit comments