11# Infinityloop Coding-Standard
22
3- Custom PHP 7.4 ruleset for [ PHP_CodeSniffer] ( https://github.com/squizlabs/PHP_CodeSniffer ) .
4-
5- It is designed for PHP 7.4 because of its specific property spacing, which is not plausible without typed properties.
3+ Custom PHP 8.0 ruleset for [ PHP_CodeSniffer] ( https://github.com/squizlabs/PHP_CodeSniffer ) .
64
75## Features
86
@@ -107,6 +105,7 @@ Detailed list of Slevomat sniffs with configured settings. Some sniffs are not i
107105 - ignoreStandaloneIfInScope: true
108106 - ignoreOneLineTrailingIf: true
109107- SlevomatCodingStandard.ControlStructures.RequireNullCoalesceEqualOperator
108+ - SlevomatCodingStandard.ControlStructures.RequireNullSafeObjectOperator
110109- SlevomatCodingStandard.Functions.StaticClosure
111110- SlevomatCodingStandard.Operators.DisallowEqualOperators
112111- SlevomatCodingStandard.Operators.RequireOnlyStandaloneIncrementAndDecrementOperators
@@ -122,9 +121,6 @@ Excluded sniffs:
122121
123122#### Cleaning
124123
125- - SlevomatCodingStandard.Classes.UnusedPrivateElements
126- - alwaysUsedPropertiesAnnotations: false
127- - alwaysUsedPropertiesSuffixes: false
128124- SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure
129125- SlevomatCodingStandard.Functions.UselessParameterDefaultValue
130126- SlevomatCodingStandard.Namespaces.UnusedUses
@@ -144,6 +140,7 @@ Excluded sniffs:
144140 - ignoreUnusedValuesWhenOnlyKeysAreUsedInForeach: true
145141- SlevomatCodingStandard.Variables.UselessVariable
146142- SlevomatCodingStandard.Exceptions.DeadCatch
143+ - SlevomatCodingStandard.Exceptions.RequireNonCapturingCatch
147144
148145Excluded sniffs:
149146
@@ -171,14 +168,16 @@ Excluded sniffs:
171168 - linesCountBeforeFirstControlStructure: 0
172169 - linesCountAfterControlStructure: 1
173170 - linesCountAfterLastControlStructure: 0
174- - tokensToCheck : [ T_SWITCH, T_TRY, T_IF, T_FOR, T_FOREACH, T_WHILE ]
171+ - controlStructures : [ switch, try, if, for, foreach, while ]
175172- SlevomatCodingStandard.ControlStructures.JumpStatementsSpacing
176173 - allowSingleLineYieldStacking: whether or not to allow multiple yield/yield from statements in a row without blank lines.
177- - linesCountBeforeControlStructure: 1
178- - linesCountBeforeFirstControlStructure: 0
179- - linesCountAfterControlStructure: 0
180- - linesCountAfterLastControlStructure: 0
181- - tokensToCheck: default
174+ - linesCountBefore: 1
175+ - linesCountBeforeFirst: 0
176+ - linesCountAfter: 0
177+ - linesCountAfterLast: 0
178+ - linesCountAfterWhenLastInCaseOrDefault: 0
179+ - linesCountAfterWhenLastInLastCaseOrDefault: 0
180+ - jumpStatements: [ goto, throw, yield, continue, break, return]
182181- SlevomatCodingStandard.ControlStructures.LanguageConstructWithParentheses
183182- SlevomatCodingStandard.ControlStructures.NewWithParentheses
184183- SlevomatCodingStandard.ControlStructures.RequireMultiLineTernaryOperator
@@ -188,7 +187,8 @@ Excluded sniffs:
188187 - ignoreMultiLine: false
189188- SlevomatCodingStandard.ControlStructures.DisallowYodaComparison
190189- SlevomatCodingStandard.Functions.DisallowArrowFunction
191- - SlevomatCodingStandard.Functions.TrailingCommaInCall
190+ - SlevomatCodingStandard.Functions.RequireTrailingCommaInCall
191+ - SlevomatCodingStandard.Functions.RequireTrailingCommaInDeclaration
192192- SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses
193193 - psr12Compatible: true
194194 - caseSensitive: true
@@ -220,9 +220,11 @@ Excluded sniffs:
220220- SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue
221221- SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing
222222- SlevomatCodingStandard.TypeHints.PropertyTypeHintSpacing
223+ - SlevomatCodingStandard.TypeHints.UnionTypeHintFormat
224+ - withSpaces: no
225+ - shortNullable: yes
226+ - nullPosition: last
223227- SlevomatCodingStandard.Namespaces.DisallowGroupUse
224- - SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameAfterKeyword
225- - keywordsToCheck: T_EXTENDS, T_IMPLEMENETS, T_USE, T_NEW, T_THROW
226228- SlevomatCodingStandard.Namespaces.FullyQualifiedExceptions
227229 - specialExceptionNames: false
228230 - ignoredNames: default
@@ -237,6 +239,7 @@ Excluded sniffs:
237239- SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation
238240- SlevomatCodingStandard.Commenting.ForbiddenAnnotations
239241 - forbiddenAnnotations: @author , @created , @version , @package , @copyright , @license , @throws
242+ - SlevomatCodingStandard.Classes.RequireConstructorPropertyPromotion
240243- SlevomatCodingStandard.Commenting.EmptyComment
241244- SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration
242245- SlevomatCodingStandard.Commenting.UselessFunctionDocComment
0 commit comments