|
15 | 15 | <exclude name="PSR2.Methods.FunctionClosingBrace.SpacingBeforeClose"/>
|
16 | 16 | <exclude name="Squiz.WhiteSpace.ControlStructureSpacing.SpacingAfterOpen"/>
|
17 | 17 | <exclude name="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose"/>
|
| 18 | + <!-- Replaced by WebimpressCodingStandard.WhiteSpace.CommaSpacing --> |
| 19 | + <exclude name="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpaceBeforeComma"/> |
| 20 | + <exclude name="Squiz.Functions.FunctionDeclarationArgumentSpacing.NoSpaceBeforeArg"/> |
| 21 | + <!-- Replaced by WebimpressCodingStandard.WhiteSpace.ScopeIndent --> |
| 22 | + <exclude name="Generic.WhiteSpace.ScopeIndent"/> |
| 23 | + <exclude name="PSR2.Methods.FunctionCallSignature.Indent"/> |
| 24 | + <exclude name="PSR2.Methods.FunctionCallSignature.OpeningIndent"/> |
| 25 | + <exclude name="Squiz.Functions.MultiLineFunctionDeclaration.Indent"/> |
| 26 | + <exclude name="Squiz.WhiteSpace.ScopeClosingBrace.Indent"/> |
18 | 27 | </rule>
|
19 | 28 |
|
20 | 29 | <!-- Force array element indentation with 4 spaces -->
|
|
34 | 43 | <!-- Forbid blank line after opening braces and before closing braces -->
|
35 | 44 | <rule ref="WebimpressCodingStandard.WhiteSpace.BraceBlankLine"/>
|
36 | 45 |
|
| 46 | + <!-- Forbid FQN for classes/traits/interfaces/constants/functions --> |
| 47 | + <rule ref="WebimpressCodingStandard.PHP.DisallowFqn"/> |
37 | 48 | <!-- Import internal constants -->
|
38 | 49 | <rule ref="WebimpressCodingStandard.PHP.ImportInternalConstant"/>
|
39 | 50 | <!-- Import internal functions -->
|
40 | 51 | <rule ref="WebimpressCodingStandard.PHP.ImportInternalFunction"/>
|
| 52 | + <!-- Format anonymous class declaration --> |
| 53 | + <rule ref="WebimpressCodingStandard.Classes.AnonymousClassDeclaration"/> |
41 | 54 | <!-- Forbid null values for class properties -->
|
42 | 55 | <rule ref="WebimpressCodingStandard.Classes.NoNullValues"/>
|
43 | 56 | <!-- Comments at the end of the line, with at least single space -->
|
|
46 | 59 | <!-- Requires one space after namespace keyword -->
|
47 | 60 | <rule ref="WebimpressCodingStandard.WhiteSpace.Namespace"/>
|
48 | 61 | <!-- Forbid spaces around namespace separator -->
|
49 |
| - <!-- TODO: Cannot be included because of error in SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly --> |
50 |
| - <!--<rule ref="WebimpressCodingStandard.WhiteSpace.NamespaceSeparator"/>--> |
| 62 | + <rule ref="WebimpressCodingStandard.WhiteSpace.NamespaceSeparator"/> |
51 | 63 |
|
52 | 64 | <!-- One space after break/continue with argument, remove redundant 1 -->
|
53 | 65 | <rule ref="WebimpressCodingStandard.ControlStructures.BreakAndContinue"/>
|
54 | 66 | <!-- Forbid continue in switch; use break instead -->
|
55 | 67 | <rule ref="WebimpressCodingStandard.ControlStructures.ContinueInSwitch"/>
|
56 | 68 |
|
| 69 | + <!-- Forbid boolean operator at the end of the line --> |
| 70 | + <rule ref="WebimpressCodingStandard.Operators.BooleanOperator"/> |
| 71 | + <!-- Formatting of ternary operator - content must be after ?/:, not in new line --> |
| 72 | + <rule ref="WebimpressCodingStandard.Operators.TernaryOperator"/> |
| 73 | + |
| 74 | + <!-- Abstract class must have Abstract* prefix --> |
| 75 | + <rule ref="WebimpressCodingStandard.NamingConventions.AbstractClass"/> |
| 76 | + <!-- Exception must have *Exception suffix --> |
| 77 | + <rule ref="WebimpressCodingStandard.NamingConventions.Exception"/> |
| 78 | + <!-- Interface must have *Interface suffix --> |
| 79 | + <rule ref="WebimpressCodingStandard.NamingConventions.Interface"/> |
| 80 | + <!-- Trait must have *Traif suffix --> |
| 81 | + <rule ref="WebimpressCodingStandard.NamingConventions.Trait"/> |
57 | 82 | <!-- Require camelCase variable names -->
|
58 | 83 | <rule ref="WebimpressCodingStandard.NamingConventions.ValidVariableName"/>
|
59 | 84 |
|
| 85 | + <!-- Use the correct class name, i.e. DateTime not Datetime, etc --> |
| 86 | + <rule ref="WebimpressCodingStandard.PHP.CorrectClassNameCase"/> |
| 87 | + |
| 88 | + <!-- Only one blank line allowed --> |
| 89 | + <rule ref="WebimpressCodingStandard.WhiteSpace.BlankLine"/> |
| 90 | + |
| 91 | + <!-- Indents formatting --> |
| 92 | + <rule ref="WebimpressCodingStandard.WhiteSpace.ScopeIndent"> |
| 93 | + <properties> |
| 94 | + <property name="alignObjectOperators" value="false"></property> |
| 95 | + </properties> |
| 96 | + </rule> |
| 97 | + |
60 | 98 | <!-- Detects for-loops that can be simplified to a while-loop -->
|
61 | 99 | <rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/>
|
62 | 100 | <!-- Detects unconditional if- and elseif-statements -->
|
63 | 101 | <rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
|
| 102 | + <!-- Disallow spaces before/after incrementation/decrementation operators --> |
| 103 | + <rule ref="Generic.WhiteSpace.IncrementDecrementSpacing"/> |
| 104 | + |
| 105 | + <!-- Forbid inline comments after closing curly bracket, like // end if etc --> |
| 106 | + <rule ref="WebimpressCodingStandard.Commenting.NoInlineCommentAfterCurlyClose"/> |
| 107 | + <!-- Use correct case of default PHPDocs and PHPUnit tags @var not @VAR etc --> |
| 108 | + <rule ref="WebimpressCodingStandard.Commenting.TagCase"/> |
| 109 | + <!-- Heredoc/nowdoc tag uppercase without spaces --> |
| 110 | + <rule ref="WebimpressCodingStandard.Formatting.Heredoc"/> |
| 111 | + |
| 112 | + <!-- Forbid space after splat operator --> |
| 113 | + <rule ref="WebimpressCodingStandard.Formatting.NoSpaceAfterSplat"/> |
| 114 | + <!-- Forbid reference operator before new, and formatting of the reference operator --> |
| 115 | + <rule ref="WebimpressCodingStandard.Formatting.Reference"/> |
| 116 | + <!-- Use ::class instead of class string reference --> |
| 117 | + <rule ref="WebimpressCodingStandard.Formatting.StringClassReference"/> |
| 118 | + <!-- Single line between methods in class --> |
| 119 | + <rule ref="WebimpressCodingStandard.Methods.LineAfter"/> |
| 120 | + |
| 121 | + <!-- Forbid space before comma, require single space after comma --> |
| 122 | + <rule ref="WebimpressCodingStandard.WhiteSpace.CommaSpacing"/> |
| 123 | + |
| 124 | + <!-- Forbid concatenation character at the end of the line --> |
| 125 | + <rule ref="WebimpressCodingStandard.Strings.NoConcatenationAtTheEnd"/> |
64 | 126 |
|
65 | 127 | <!-- Forbid duplicate classes -->
|
66 | 128 | <rule ref="Generic.Classes.DuplicateClassName"/>
|
|
177 | 239 | <element value="@package"/>
|
178 | 240 | <element value="@subpackage"/>
|
179 | 241 | <element value="@version"/>
|
| 242 | + <element value="@expectedException"/> |
| 243 | + <element value="@expectedExceptionCode"/> |
| 244 | + <element value="@expectedExceptionMessage"/> |
| 245 | + <element value="@expectedExceptionMessageRegExp"/> |
180 | 246 | </property>
|
181 | 247 | </properties>
|
182 | 248 | </rule>
|
|
201 | 267 | <!-- Require language constructs without parentheses -->
|
202 | 268 | <rule ref="SlevomatCodingStandard.ControlStructures.LanguageConstructWithParentheses"/>
|
203 | 269 | <!-- Require new instances with parentheses -->
|
204 |
| - <rule ref="WebimpressCodingStandard.PHP.InstantiatingParenthesis"/> |
| 270 | + <rule ref="PSR12.Classes.ClassInstantiation"/> |
205 | 271 | <!-- Require usage of null coalesce operator when possible -->
|
206 | 272 | <rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator"/>
|
207 | 273 | <!-- Forbid useless unreachable catch blocks -->
|
|
224 | 290 | <rule ref="SlevomatCodingStandard.Namespaces.MultipleUsesPerLine"/>
|
225 | 291 | <!-- Require newlines around namespace declaration -->
|
226 | 292 | <rule ref="SlevomatCodingStandard.Namespaces.NamespaceSpacing"/>
|
227 |
| - <!-- Forbid using absolute class name references (except global ones) --> |
228 |
| - <rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly"> |
229 |
| - <properties> |
230 |
| - <property name="allowFallbackGlobalConstants" value="false"/> |
231 |
| - <property name="allowFallbackGlobalFunctions" value="false"/> |
232 |
| - <property name="allowFullyQualifiedGlobalClasses" value="false"/> |
233 |
| - <property name="allowFullyQualifiedGlobalConstants" value="false"/> |
234 |
| - <property name="allowFullyQualifiedGlobalFunctions" value="false"/> |
235 |
| - <property name="allowFullyQualifiedNameForCollidingClasses" value="true"/> |
236 |
| - <property name="allowFullyQualifiedNameForCollidingConstants" value="true"/> |
237 |
| - <property name="allowFullyQualifiedNameForCollidingFunctions" value="true"/> |
238 |
| - <property name="searchAnnotations" value="true"/> |
239 |
| - </properties> |
240 |
| - </rule> |
241 |
| - <!-- Forbid useless alias for classes, constants and functions --> |
242 |
| - <rule ref="SlevomatCodingStandard.Namespaces.UselessAlias"/> |
| 293 | + <!-- Forbid useless alias for classes, constants, functions and traits functions --> |
| 294 | + <rule ref="WebimpressCodingStandard.Namespaces.RedundantAlias"/> |
243 | 295 | <!-- Require the usage of assignment operators, eg `+=`, `.=` when possible -->
|
244 | 296 | <rule ref="SlevomatCodingStandard.Operators.RequireCombinedAssignmentOperator"/>
|
245 | 297 | <!-- Forbid `list(...)` syntax, use [...] instead -->
|
246 | 298 | <rule ref="SlevomatCodingStandard.PHP.ShortList"/>
|
247 | 299 | <!-- Forbid use of longhand cast operators -->
|
248 | 300 | <rule ref="SlevomatCodingStandard.PHP.TypeCast"/>
|
249 | 301 | <!-- Require presence of declare(strict_types=1) -->
|
250 |
| - <rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes"> |
251 |
| - <properties> |
252 |
| - <property name="newlinesCountBetweenOpenTagAndDeclare" value="2"/> |
253 |
| - <property name="spacesCountAroundEqualsSign" value="0"/> |
254 |
| - <property name="newlinesCountAfterDeclare" value="2"/> |
255 |
| - </properties> |
256 |
| - </rule> |
| 302 | + <rule ref="WebimpressCodingStandard.Files.DeclareStrictTypes"/> |
| 303 | + <!-- Format of strict type declaration --> |
| 304 | + <rule ref="WebimpressCodingStandard.PHP.DeclareStrictTypes"/> |
257 | 305 | <!-- Forbid useless parentheses -->
|
258 |
| - <rule ref="WebimpressCodingStandard.Formatting.UnnecessaryParentheses"/> |
259 |
| - <!-- Forbid useless semicolon `;` --> |
260 |
| - <rule ref="SlevomatCodingStandard.PHP.UselessSemicolon"/> |
| 306 | + <rule ref="WebimpressCodingStandard.Formatting.RedundantParentheses"/> |
| 307 | + <!-- Forbid redundant semicolons --> |
| 308 | + <rule ref="WebimpressCodingStandard.PHP.RedundantSemicolon"/> |
261 | 309 | <!-- Require use of short versions of scalar types (i.e. int instead of integer) -->
|
262 | 310 | <rule ref="SlevomatCodingStandard.TypeHints.LongTypeHints"/>
|
263 | 311 | <!-- Require ? when default value is null -->
|
264 | 312 | <rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue"/>
|
| 313 | + <!-- Disallow space after nullable operator --> |
| 314 | + <rule ref="PSR12.Functions.NullableTypeDeclaration"/> |
265 | 315 | <!-- Require one space between typehint and variable, require no space between nullability sign and typehint -->
|
266 | 316 | <rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing"/>
|
267 | 317 | <!-- Require space around colon in return types -->
|
|
281 | 331 | <exclude name="Squiz.Commenting.DocCommentAlignment.SpaceAfterStar"/>
|
282 | 332 | </rule>
|
283 | 333 | <!-- Force rules for function phpDoc -->
|
284 |
| - <rule ref="Squiz.Commenting.FunctionComment"> |
| 334 | + <rule ref="PEAR.Commenting.FunctionComment"> |
285 | 335 | <!-- Allow `@throws` without description -->
|
286 |
| - <exclude name="Squiz.Commenting.FunctionComment.EmptyThrows"/> |
| 336 | + <exclude name="PEAR.Commenting.FunctionComment.EmptyThrows"/> |
287 | 337 | <!-- Does not work properly with PHP 7 / short-named types -->
|
288 |
| - <exclude name="Squiz.Commenting.FunctionComment.IncorrectParamVarName"/> |
| 338 | + <exclude name="PEAR.Commenting.FunctionComment.IncorrectParamVarName"/> |
289 | 339 | <!-- Does not support collections, i.e. `string[]` -->
|
290 |
| - <exclude name="Squiz.Commenting.FunctionComment.IncorrectTypeHint"/> |
| 340 | + <exclude name="PEAR.Commenting.FunctionComment.IncorrectTypeHint"/> |
291 | 341 | <!-- Forces incorrect types -->
|
292 |
| - <exclude name="Squiz.Commenting.FunctionComment.InvalidReturn"/> |
| 342 | + <exclude name="PEAR.Commenting.FunctionComment.InvalidReturn"/> |
293 | 343 | <!-- Breaks with compound return types, i.e. `string|null` -->
|
294 |
| - <exclude name="Squiz.Commenting.FunctionComment.InvalidReturnNotVoid"/> |
| 344 | + <exclude name="PEAR.Commenting.FunctionComment.InvalidReturnNotVoid"/> |
295 | 345 | <!-- Breaks when all params are not documented -->
|
296 |
| - <exclude name="Squiz.Commenting.FunctionComment.InvalidTypeHint"/> |
| 346 | + <exclude name="PEAR.Commenting.FunctionComment.InvalidTypeHint"/> |
297 | 347 | <!-- Doc comment is not required for every method -->
|
298 |
| - <exclude name="Squiz.Commenting.FunctionComment.Missing"/> |
| 348 | + <exclude name="PEAR.Commenting.FunctionComment.Missing"/> |
299 | 349 | <!-- Do not require comments for `@param` -->
|
300 |
| - <exclude name="Squiz.Commenting.FunctionComment.MissingParamComment"/> |
| 350 | + <exclude name="PEAR.Commenting.FunctionComment.MissingParamComment"/> |
301 | 351 | <!-- Do not require `@param` for all parameters -->
|
302 |
| - <exclude name="Squiz.Commenting.FunctionComment.MissingParamTag"/> |
| 352 | + <exclude name="PEAR.Commenting.FunctionComment.MissingParamTag"/> |
303 | 353 | <!-- Do not require `@return` for void methods -->
|
304 |
| - <exclude name="Squiz.Commenting.FunctionComment.MissingReturn"/> |
| 354 | + <exclude name="PEAR.Commenting.FunctionComment.MissingReturn"/> |
305 | 355 | <!-- Comments don't have to be sentences -->
|
306 |
| - <exclude name="Squiz.Commenting.FunctionComment.ParamCommentFullStop"/> |
| 356 | + <exclude name="PEAR.Commenting.FunctionComment.ParamCommentFullStop"/> |
307 | 357 | <!-- Comments don't have to be sentences -->
|
308 |
| - <exclude name="Squiz.Commenting.FunctionComment.ParamCommentNotCapital"/> |
| 358 | + <exclude name="PEAR.Commenting.FunctionComment.ParamCommentNotCapital"/> |
309 | 359 | <!-- Breaks when all params are not documented -->
|
310 |
| - <exclude name="Squiz.Commenting.FunctionComment.ParamNameNoMatch"/> |
| 360 | + <exclude name="PEAR.Commenting.FunctionComment.ParamNameNoMatch"/> |
311 | 361 | <!-- Doesn't respect inheritance -->
|
312 |
| - <exclude name="Squiz.Commenting.FunctionComment.ScalarTypeHintMissing"/> |
| 362 | + <exclude name="PEAR.Commenting.FunctionComment.ScalarTypeHintMissing"/> |
313 | 363 | <!-- Throws comments can start without a capital and doesn't need a full stop -->
|
314 |
| - <exclude name="Squiz.Commenting.FunctionComment.ThrowsNoFullStop"/> |
315 |
| - <exclude name="Squiz.Commenting.FunctionComment.ThrowsNotCapital"/> |
| 364 | + <exclude name="PEAR.Commenting.FunctionComment.ThrowsNoFullStop"/> |
| 365 | + <exclude name="PEAR.Commenting.FunctionComment.ThrowsNotCapital"/> |
316 | 366 | <!-- Doesn't work with self as typehint -->
|
317 |
| - <exclude name="Squiz.Commenting.FunctionComment.TypeHintMissing"/> |
| 367 | + <exclude name="PEAR.Commenting.FunctionComment.TypeHintMissing"/> |
318 | 368 | </rule>
|
319 | 369 | <!-- Forbid `AND` and `OR`, require `&&` and `||` -->
|
320 | 370 | <rule ref="Squiz.Operators.ValidLogicalOperators"/>
|
|
0 commit comments