Skip to content

Commit 6bc5eeb

Browse files
committed
WIP v0.6
1 parent 8075258 commit 6bc5eeb

File tree

7 files changed

+305
-181
lines changed

7 files changed

+305
-181
lines changed

CHANGELOG.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,39 @@
11
# Changelog
22

3-
## v0.5.x
3+
## v0.6.x
44

5-
### v0.5.0
5+
### v0.6.0 - NOT RELEASED YET
6+
7+
> Requires Slevomat coding standards 6.3 or higher
8+
9+
**Added rules:**
10+
- Generic.Files.InlineHTML
11+
- Generic.NamingConventions.ConstructorName
12+
- PEAR.Formatting.MultiLineAssignment
13+
- SlevomatCodingStandard.Classes.UnusedPrivateElements
14+
- SlevomatCodingStandard.ControlStructures.DisallowContinueWithoutIntegerOperandInSwitch
15+
- SlevomatCodingStandard.ControlStructures.NewWithParentheses
16+
- SlevomatCodingStandard.ControlStructures.RequireMultiLineTernaryOperator
17+
- SlevomatCodingStandard.Operators.RequireCombinedAssignmentOperator
18+
- SlevomatCodingStandard.Operators.SpreadOperatorSpacing
19+
- SlevomatCodingStandard.PHP.ReferenceSpacing
20+
- SlevomatCodingStandard.PHP.UselessSemicolon
21+
- SlevomatCodingStandard.PHP.UselessParentheses
22+
- SlevomatCodingStandard.Variables.DuplicateAssignmentToVariable
23+
24+
**Added strict rules:**
25+
- Generic.Formatting.SpaceAfterNot
26+
- SlevomatCodingStandard.Arrays.DisallowImplicitArrayCreation
27+
- SlevomatCodingStandard.Arrays.SingleLineArrayWhitespace
28+
- SlevomatCodingStandard.Commenting.ForbiddenAnnotations
29+
- SlevomatCodingStandard.ControlStructures.AssignmentInCondition
30+
- SlevomatCodingStandard.ControlStructures.RequireShortTernaryOperator
31+
- SlevomatCodingStandard.ControlStructures.UselessIfConditionWithReturn
32+
- SlevomatCodingStandard.ControlStructures.UselessTernaryOperator
33+
- SlevomatCodingStandard.TypeHints.NullTypeHintOnLastPosition
34+
- Squiz.PHP.CommentedOutCode
35+
36+
## v0.5.0
637

738
> Requires Slevomat coding standards 6.2 or higher
839

README.md

Lines changed: 15 additions & 179 deletions
Original file line numberDiff line numberDiff line change
@@ -48,184 +48,20 @@ Later more additional rules can be added. See *phpcs.example.xml*.
4848

4949
## Included sniffs
5050

51+
See [SniffList](SniffsList.md)<br>
5152
There is no really good documentation for sniffs. I wrote one sentence explanation for each used sniff into XML files.
5253

53-
### Generic (34 sniffs)
54-
- Generic.Arrays.ArrayIndent
55-
- Generic.Arrays.DisallowLongArraySyntax
56-
- Generic.Classes.DuplicateClassName
57-
- Generic.CodeAnalysis.AssignmentInCondition
58-
- Generic.CodeAnalysis.EmptyStatement
59-
- Generic.CodeAnalysis.ForLoopShouldBeWhileLoop
60-
- Generic.CodeAnalysis.UnconditionalIfStatement
61-
- Generic.CodeAnalysis.UnnecessaryFinalModifier
62-
- Generic.CodeAnalysis.UselessOverridingMethod
63-
- Generic.Commenting.DocComment
64-
- Generic.ControlStructures.InlineControlStructure
65-
- Generic.Files.ByteOrderMark
66-
- Generic.Files.LineEndings
67-
- Generic.Files.LineLength
68-
- Generic.Formatting.DisallowMultipleStatements
69-
- Generic.Formatting.NoSpaceAfterCast
70-
- Generic.Functions.FunctionCallArgumentSpacing
71-
- Generic.NamingConventions.UpperCaseConstantName
72-
- Generic.PHP.CharacterBeforePHPOpeningTag
73-
- Generic.PHP.DeprecatedFunctions
74-
- Generic.PHP.DisallowAlternativePHPTags
75-
- Generic.PHP.DisallowShortOpenTag
76-
- Generic.PHP.ForbiddenFunctions
77-
- Generic.PHP.LowerCaseConstant
78-
- Generic.PHP.LowerCaseKeyword
79-
- Generic.PHP.LowerCaseType
80-
- Generic.PHP.NoSilencedErrors
81-
- Generic.Strings.UnnecessaryStringConcat
82-
- Generic.WhiteSpace.ArbitraryParenthesesSpacing
83-
- Generic.WhiteSpace.DisallowSpaceIndent - *Depends on selected indentation configuration*
84-
- Generic.WhiteSpace.DisallowTabIndent - *Depends on selected indentation configuration*
85-
- Generic.WhiteSpace.IncrementDecrementSpacing
86-
- Generic.WhiteSpace.LanguageConstructSpacing
87-
- Generic.WhiteSpace.ScopeIndent
88-
- Generic.WhiteSpace.SpreadOperatorSpacingAfter
89-
90-
### PEAR (4 sniffs)
91-
- PEAR.Commenting.FunctionComment
92-
- PEAR.Commenting.InlineComment
93-
- PEAR.Functions.ValidDefaultValue
94-
- PEAR.WhiteSpace.ObjectOperatorIndent
95-
96-
### PSR1 (3 sniffs)
97-
- PSR1.Classes.ClassDeclaration
98-
- PSR1.Files.SideEffects
99-
- PSR1.Methods.CamelCapsMethodName
100-
101-
### PSR12 (16 sniffs)
102-
- PSR12.Classes.AnonClassDeclaration
103-
- PSR12.Classes.ClassInstantiation
104-
- PSR12.Classes.ClosingBrace
105-
- PSR12.ControlStructures.BooleanOperatorPlacement
106-
- PSR12.ControlStructures.ControlStructureSpacing
107-
- PSR12.Files.DeclareStatement
108-
- PSR12.Files.FileHeader
109-
- PSR12.Files.ImportStatement
110-
- PSR12.Files.OpenTag
111-
- PSR12.Functions.NullableTypeDeclaration
112-
- PSR12.Functions.ReturnTypeDeclaration
113-
- PSR12.Keywords.ShortFormTypeKeywords
114-
- PSR12.Namespaces.CompoundNamespaceDepth
115-
- PSR12.Operators.OperatorSpacing
116-
- PSR12.Properties.ConstantVisibility
117-
- PSR12.Traits.UseDeclaration
118-
119-
### PSR2 (12 sniffs)
120-
- PSR2.Classes.ClassDeclaration
121-
- PSR2.Classes.PropertyDeclaration
122-
- PSR2.ControlStructures.ControlStructureSpacing
123-
- PSR2.ControlStructures.ElseIfDeclaration
124-
- PSR2.ControlStructures.SwitchDeclaration
125-
- PSR2.Files.ClosingTag
126-
- PSR2.Files.EndFileNewline
127-
- PSR2.Methods.FunctionCallSignature
128-
- PSR2.Methods.FunctionClosingBrace
129-
- PSR2.Methods.MethodDeclaration
130-
- PSR2.Namespaces.NamespaceDeclaration
131-
- PSR2.Namespaces.UseDeclaration
132-
133-
### SlevomatCodingStandard (62 sniffs)
134-
- SlevomatCodingStandard.Arrays.MultiLineArrayEndBracketPlacement
135-
- SlevomatCodingStandard.Arrays.TrailingArrayComma
136-
- SlevomatCodingStandard.Classes.ConstantSpacing
137-
- SlevomatCodingStandard.Classes.DisallowLateStaticBindingForConstants
138-
- SlevomatCodingStandard.Classes.DisallowMultiConstantDefinition
139-
- SlevomatCodingStandard.Classes.DisallowMultiPropertyDefinition
140-
- SlevomatCodingStandard.Classes.EmptyLinesAroundClassBraces
141-
- SlevomatCodingStandard.Classes.ModernClassNameReference
142-
- SlevomatCodingStandard.Classes.ParentCallSpacing
143-
- SlevomatCodingStandard.Classes.PropertySpacing
144-
- SlevomatCodingStandard.Classes.RequireMultiLineMethodSignature
145-
- SlevomatCodingStandard.Classes.RequireSingleLineMethodSignature
146-
- SlevomatCodingStandard.Classes.TraitUseSpacing
147-
- SlevomatCodingStandard.Classes.UselessLateStaticBinding
148-
- SlevomatCodingStandard.Commenting.EmptyComment
149-
- SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration
150-
- SlevomatCodingStandard.Commenting.RequireOneLinePropertyDocComment
151-
- SlevomatCodingStandard.Commenting.UselessFunctionDocComment
152-
- SlevomatCodingStandard.ControlStructures.EarlyExit
153-
- SlevomatCodingStandard.ControlStructures.JumpStatementsSpacing
154-
- SlevomatCodingStandard.ControlStructures.LanguageConstructWithParentheses
155-
- SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator
156-
- SlevomatCodingStandard.Exceptions.DeadCatch
157-
- SlevomatCodingStandard.Exceptions.ReferenceThrowableOnly
158-
- SlevomatCodingStandard.Functions.ArrowFunctionDeclaration
159-
- SlevomatCodingStandard.Functions.DisallowEmptyFunction
160-
- SlevomatCodingStandard.Functions.StaticClosure
161-
- SlevomatCodingStandard.Functions.TrailingCommaInCall
162-
- SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure
163-
- SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses
164-
- SlevomatCodingStandard.Namespaces.DisallowGroupUse
165-
- SlevomatCodingStandard.Namespaces.FullyQualifiedExceptions
166-
- SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalConstants
167-
- SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalFunctions
168-
- SlevomatCodingStandard.Namespaces.NamespaceDeclaration
169-
- SlevomatCodingStandard.Namespaces.NamespaceSpacing
170-
- SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly
171-
- SlevomatCodingStandard.Namespaces.RequireOneNamespaceInFile
172-
- SlevomatCodingStandard.Namespaces.UnusedUses
173-
- SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash
174-
- SlevomatCodingStandard.Namespaces.UseSpacing
175-
- SlevomatCodingStandard.Namespaces.UselessAlias
176-
- SlevomatCodingStandard.Numbers.DisallowNumericLiteralSeparator
177-
- SlevomatCodingStandard.Operators.DisallowEqualOperators
178-
- SlevomatCodingStandard.Operators.DisallowIncrementAndDecrementOperators
179-
- SlevomatCodingStandard.Operators.NegationOperatorSpacing
180-
- SlevomatCodingStandard.PHP.DisallowDirectMagicInvokeCall
181-
- SlevomatCodingStandard.PHP.OptimizedFunctionsWithoutUnpacking
182-
- SlevomatCodingStandard.PHP.ShortList
183-
- SlevomatCodingStandard.PHP.TypeCast
184-
- SlevomatCodingStandard.TypeHints.DeclareStrictTypes
185-
- SlevomatCodingStandard.TypeHints.LongTypeHints
186-
- SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue
187-
- SlevomatCodingStandard.TypeHints.ParameterTypeHint
188-
- SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing
189-
- SlevomatCodingStandard.TypeHints.PropertyTypeHint
190-
- SlevomatCodingStandard.TypeHints.PropertyTypeHintSpacing
191-
- SlevomatCodingStandard.TypeHints.ReturnTypeHint
192-
- SlevomatCodingStandard.TypeHints.UselessConstantTypeHint
193-
- SlevomatCodingStandard.Variables.DisallowSuperGlobalVariable
194-
- SlevomatCodingStandard.Variables.UnusedVariable
195-
- SlevomatCodingStandard.Whitespaces.DuplicateSpaces
196-
197-
### Squiz (34 sniffs)
198-
- Squiz.Arrays.ArrayBracketSpacing
199-
- Squiz.Arrays.ArrayDeclaration
200-
- Squiz.Classes.ClassFileName
201-
- Squiz.Classes.SelfMemberReference
202-
- Squiz.Classes.ValidClassName
203-
- Squiz.Commenting.DocCommentAlignment
204-
- Squiz.Commenting.EmptyCatchComment
205-
- Squiz.Commenting.FunctionComment
206-
- Squiz.ControlStructures.ControlSignature
207-
- Squiz.ControlStructures.ForEachLoopDeclaration
208-
- Squiz.ControlStructures.ForLoopDeclaration
209-
- Squiz.ControlStructures.LowercaseDeclaration
210-
- Squiz.Functions.FunctionDeclaration
211-
- Squiz.Functions.FunctionDeclarationArgumentSpacing
212-
- Squiz.Functions.LowercaseFunctionKeywords
213-
- Squiz.Functions.MultiLineFunctionDeclaration
214-
- Squiz.Operators.ValidLogicalOperators
215-
- Squiz.PHP.Eval
216-
- Squiz.PHP.GlobalKeyword
217-
- Squiz.PHP.Heredoc
218-
- Squiz.PHP.InnerFunctions
219-
- Squiz.PHP.LowercasePHPFunctions
220-
- Squiz.PHP.NonExecutableCode
221-
- Squiz.Scope.MethodScope
222-
- Squiz.Scope.StaticThisUsage
223-
- Squiz.Strings.DoubleQuoteUsage
224-
- Squiz.WhiteSpace.CastSpacing
225-
- Squiz.WhiteSpace.ControlStructureSpacing
226-
- Squiz.WhiteSpace.FunctionSpacing
227-
- Squiz.WhiteSpace.ObjectOperatorSpacing
228-
- Squiz.WhiteSpace.ScopeClosingBrace
229-
- Squiz.WhiteSpace.ScopeKeywordSpacing
230-
- Squiz.WhiteSpace.SemicolonSpacing
231-
- Squiz.WhiteSpace.SuperfluousWhitespace
54+
### More suggested
55+
56+
#### Check that Namespace matches file structure
57+
This is used from my own blog in Laravel, where main folder `app` is `BlogApp` namespace.
58+
59+
```xml
60+
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
61+
<properties>
62+
<property name="rootNamespaces" type="array">
63+
<element key="app" value="BlogApp"/>
64+
</property>
65+
</properties>
66+
</rule>
67+
```

Rules/Parts/phpcs-generic.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/> <!-- Disable if(true) etc... -->
2525
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/> <!-- When final is for class and for method again -->
2626
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/> <!-- When method only calls parent, nothing more -->
27+
<rule ref="Generic.Files.InlineHTML"/> <!-- Disables Inline HTML inside file -->
2728
<rule ref="Generic.Formatting.NoSpaceAfterCast"/> <!-- Disable space after cast, ie (int) $var -->
29+
<rule ref="Generic.NamingConventions.ConstructorName"/> <!-- Check of usage old constructor naming -->
2830
<rule ref="Generic.PHP.CharacterBeforePHPOpeningTag"/> <!-- No chars before PHP opening tag -->
2931
<rule ref="Generic.PHP.DeprecatedFunctions"/> <!-- Disable deprecated function -->
3032
<rule ref="Generic.PHP.ForbiddenFunctions"> <!-- Ban listed functions -->

Rules/Parts/phpcs-pear.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<rule ref="PEAR.Commenting.InlineComment"/> <!-- Disable PERL comments style ie # -->
44
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfter"/> <!-- No space after function comment -->
55
<rule ref="PEAR.Commenting.FunctionComment.ParamNameNoMatch"/> <!-- Check different names in method and in doc block -->
6+
<rule ref="PEAR.Formatting.MultiLineAssignment"/> <!-- Multiline assignment must have = on new line -->
67
<rule ref="PEAR.WhiteSpace.ObjectOperatorIndent"/> <!-- Correct formatting when chaining method calls -->
78
</ruleset>
89

Rules/Parts/phpcs-slevomat.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@
3030
<property name="linesCountAfterLastUseWhenLastInClass" value="0"/>
3131
</properties>
3232
</rule>
33+
<rule ref="SlevomatCodingStandard.Classes.UnusedPrivateElements"/> <!-- Check for private properties which are never read, only written -->
3334
<rule ref="SlevomatCodingStandard.Classes.UselessLateStaticBinding"/> <!-- Replace static:: into self:: when class/method is final -->
3435
<rule ref="SlevomatCodingStandard.Commenting.EmptyComment"/> <!-- Disable empty comments -->
3536
<rule ref="SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration"/> <!-- Check valid inline @var doc -->
3637
<rule ref="SlevomatCodingStandard.Commenting.RequireOneLinePropertyDocComment"/> <!-- Use single line comment for property -->
38+
<rule ref="SlevomatCodingStandard.ControlStructures.DisallowContinueWithoutIntegerOperandInSwitch"/> <!-- Name explains it well -->
3739
<rule ref="SlevomatCodingStandard.ControlStructures.EarlyExit"> <!-- Check useless nesting if return or exit is in scope -->
3840
<properties>
3941
<property name="ignoreStandaloneIfInScope" value="true"/>
@@ -44,6 +46,12 @@
4446
</rule>
4547
<rule ref="SlevomatCodingStandard.ControlStructures.JumpStatementsSpacing"/> <!-- Return, break etc must have empty lines before, if not first in scope -->
4648
<rule ref="SlevomatCodingStandard.ControlStructures.LanguageConstructWithParentheses"/> <!-- Disable parentheses for some PHP constructs like break, return, echo -->
49+
<rule ref="SlevomatCodingStandard.ControlStructures.NewWithParentheses"/> <!-- New must have () even when no params are passed -->
50+
<rule ref="SlevomatCodingStandard.ControlStructures.RequireMultiLineTernaryOperator"> <!-- Can fix too line length for ternary operator -->
51+
<properties>
52+
<property name="lineLengthLimit" value="120"/>
53+
</properties>
54+
</rule>
4755
<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator"/> <!-- Use null coalesce ?? instead of ternary when possible -->
4856
<rule ref="SlevomatCodingStandard.Exceptions.DeadCatch"/> <!-- Check unreachable catch blocks -->
4957
<rule ref="SlevomatCodingStandard.Exceptions.ReferenceThrowableOnly"/> <!-- \Exception should be \Throwable -->
@@ -79,11 +87,21 @@
7987
<rule ref="SlevomatCodingStandard.Numbers.DisallowNumericLiteralSeparator"/> <!-- Disable write number with _ between thousands etc -->
8088
<rule ref="SlevomatCodingStandard.Namespaces.UseSpacing"/> <!-- Empty lines around use statements -->
8189
<rule ref="SlevomatCodingStandard.Operators.NegationOperatorSpacing"/> <!-- No spaces after - (minus) when is meant as negative number -->
90+
<rule ref="SlevomatCodingStandard.Operators.RequireCombinedAssignmentOperator"/> <!-- Disable $a = $a +1 but requires += etc -->
91+
<rule ref="SlevomatCodingStandard.Operators.SpreadOperatorSpacing"/> <!-- No space after ... operator -->
8292
<rule ref="SlevomatCodingStandard.PHP.DisallowDirectMagicInvokeCall"/> <!-- Cannot call directly __invoke method -->
8393
<rule ref="SlevomatCodingStandard.PHP.OptimizedFunctionsWithoutUnpacking"/> <!-- In listed function ... must not be used -->
94+
<rule ref="SlevomatCodingStandard.PHP.ReferenceSpacing"/> <!-- No spaces after references reference operator -->
8495
<rule ref="SlevomatCodingStandard.PHP.ShortList"/> <!-- Disable list() use [] -->
8596
<rule ref="SlevomatCodingStandard.PHP.TypeCast"/> <!-- Enforces using shorthand cast operators integer -> int -->
97+
<rule ref="SlevomatCodingStandard.PHP.UselessSemicolon"/> <!-- Check extra semicolon which is superfluous -->
98+
<rule ref="SlevomatCodingStandard.PHP.UselessParentheses">
99+
<properties>
100+
<proerty name="ignoreComplexTernaryConditions" value="true"/>
101+
</properties>
102+
</rule>
86103
<rule ref="SlevomatCodingStandard.Variables.DisallowSuperGlobalVariable"/> <!-- Global variables are prohibited -->
104+
<rule ref="SlevomatCodingStandard.Variables.DuplicateAssignmentToVariable"/> <!-- Check duplicate assignment into same variable -->
87105
<rule ref="SlevomatCodingStandard.Variables.UnusedVariable"/> <!-- Try to detect unused variables -->
88106
<rule ref="SlevomatCodingStandard.Whitespaces.DuplicateSpaces"> <!-- Detect duplicate spaces except assignment and comments -->
89107
<properties>

Rules/phpcs-strict.xml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33

44
<config name="installed_paths" value="../../slevomat/coding-standard"/>
55

6+
<!-- Generic -->
7+
<rule ref="Generic.Formatting.SpaceAfterNot"> <!-- Checks there is 0 lines after ! operator -->
8+
<properties>
9+
<property name="spacing" value="0"/>
10+
</properties>
11+
</rule>
12+
13+
<!-- PEAR -->
614
<rule ref="PEAR.Commenting.FunctionComment.ParamNameNoMatch"> <!-- Causing conflicts with stricter Slevomat rules -->
715
<severity>0</severity>
816
</rule>
@@ -13,11 +21,34 @@
1321
<severity>5</severity>
1422
<message>Variable "%s" not allowed in double quoted string; use sprintf() instead</message>
1523
</rule>
24+
<rule ref="Squiz.PHP.CommentedOutCode"/> <!-- Disable commenting code -->
1625

1726
<!-- Slevomat -->
27+
<rule ref="SlevomatCodingStandard.Arrays.DisallowImplicitArrayCreation"/> <!-- Check using of $a[] without specifying $a is array -->
28+
<rule ref="SlevomatCodingStandard.Arrays.SingleLineArrayWhitespace"/> <!-- Check no empty spaces in array defining in the beginning and end -->
29+
<rule ref="SlevomatCodingStandard.Commenting.ForbiddenAnnotations"> <!-- Disable listed annotations -->
30+
<properties>
31+
<property name="forbiddenAnnotations" type="array">
32+
<element value="@author"/>
33+
<element value="@created"/>
34+
<element value="@copyright"/>
35+
<element value="@license"/>
36+
<element value="@package"/>
37+
<element value="@version"/>
38+
</property>
39+
</properties>
40+
</rule>
1841
<rule ref="SlevomatCodingStandard.Commenting.UselessFunctionDocComment"> <!-- If native type hints does enough, function comment can be useless -->
1942
<type>warning</type>
2043
</rule>
44+
<rule ref="SlevomatCodingStandard.ControlStructures.AssignmentInCondition"/> <!-- Only comparison in condition, no assignment -->
45+
<rule ref="SlevomatCodingStandard.ControlStructures.RequireShortTernaryOperator"/> <!-- Require ?: if possible -->
46+
<rule ref="SlevomatCodingStandard.ControlStructures.UselessIfConditionWithReturn"> <!-- Check usage of if with only return true/false followed by return true/false -->
47+
<properties>
48+
<property name="assumeAllConditionExpressionsAreAlreadyBoolean" value="true"/>
49+
</properties>
50+
</rule>
51+
<rule ref="SlevomatCodingStandard.ControlStructures.UselessTernaryOperator"/> <!-- Check when ternary operator can be shortened -->
2152
<rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators"/> <!-- Disallow use == or != and must use === and !== -->
2253
<rule ref="SlevomatCodingStandard.Operators.DisallowIncrementAndDecrementOperators"/> <!-- Disable use of $i++ must use $i += 1 etc.. -->
2354
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes"> <!-- File must have declare strict types with correct spacing -->
@@ -28,6 +59,7 @@
2859
</rule>
2960
<rule ref="SlevomatCodingStandard.TypeHints.LongTypeHints"/> <!-- Disable long type hints -->
3061
<rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue"/> <!-- Parameter must be nullable if has null default value -->
62+
<rule ref="SlevomatCodingStandard.TypeHints.NullTypeHintOnLastPosition"/> <!-- In doc block |null must be last -->
3163
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint"/> <!-- Check correct type hints -->
3264
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.UselessAnnotation">
3365
<severity>0</severity>

0 commit comments

Comments
 (0)