Skip to content

Commit

Permalink
Merge pull request #10 from vossik/update
Browse files Browse the repository at this point in the history
fixed sniffs conflict, readme
  • Loading branch information
peldax committed May 21, 2021
2 parents 32ccf27 + be51329 commit 109bcf1
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 38 deletions.
47 changes: 24 additions & 23 deletions InfinityloopCodingStandard/ruleset.xml
Expand Up @@ -333,18 +333,18 @@
<rule ref="SlevomatCodingStandard.ControlStructures.AssignmentInCondition"/>
<rule ref="SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing">
<properties>
<property name="tokensToCheck" type="array">
<element value="T_SWITCH"/>
<element value="T_TRY"/>
<element value="T_IF"/>
<element value="T_FOR"/>
<element value="T_FOREACH"/>
<element value="T_WHILE"/>
<property name="linesCountBefore" value="1"/>
<property name="linesCountBeforeFirst" value="0"/>
<property name="linesCountAfter" value="1"/>
<property name="linesCountAfterLast" value="0"/>
<property name="controlStructures" type="array">
<element value="switch"/>
<element value="try"/>
<element value="if"/>
<element value="for"/>
<element value="foreach"/>
<element value="while"/>
</property>
<property name="linesCountBeforeControlStructure" value="1"/>
<property name="linesCountBeforeFirstControlStructure" value="0"/>
<property name="linesCountAfterControlStructure" value="1"/>
<property name="linesCountAfterLastControlStructure" value="0"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.ControlStructures.DisallowContinueWithoutIntegerOperandInSwitch"/>
Expand All @@ -356,20 +356,21 @@
</rule>
<rule ref="SlevomatCodingStandard.ControlStructures.JumpStatementsSpacing">
<properties>
<property name="tokensToCheck" type="array">
<element value="T_GOTO"/>
<element value="T_THROW"/>
<element value="T_YIELD"/>
<element value="T_YIELD_FROM"/>
<element value="T_CONTINUE"/>
<element value="T_BREAK"/>
<element value="T_RETURN"/>
<property name="linesCountBefore" value="1"/>
<property name="linesCountBeforeFirst" value="0"/>
<property name="linesCountAfter" value="1"/>
<property name="linesCountAfterLast" value="0"/>
<property name="linesCountAfterWhenLastInCaseOrDefault" value="0"/>
<property name="linesCountAfterWhenLastInLastCaseOrDefault" value="0"/>
<property name="jumpStatements" type="array">
<element value="goto"/>
<element value="throw"/>
<element value="yield"/>
<element value="continue"/>
<element value="break"/>
<element value="return"/>
</property>
</properties>
<property name="linesCountBeforeControlStructure" value="1"/>
<property name="linesCountBeforeFirstControlStructure" value="0"/>
<property name="linesCountAfterControlStructure" value="0"/>
<property name="linesCountAfterLastControlStructure" value="0"/>
</rule>
<rule ref="SlevomatCodingStandard.ControlStructures.RequireMultiLineTernaryOperator">
<properties>
Expand Down
33 changes: 18 additions & 15 deletions README.md
@@ -1,8 +1,6 @@
# Infinityloop Coding-Standard

Custom PHP 7.4 ruleset for [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer).

It is designed for PHP 7.4 because of its specific property spacing, which is not plausible without typed properties.
Custom PHP 8.0 ruleset for [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer).

## Features

Expand Down Expand Up @@ -107,6 +105,7 @@ Detailed list of Slevomat sniffs with configured settings. Some sniffs are not i
- ignoreStandaloneIfInScope: true
- ignoreOneLineTrailingIf: true
- SlevomatCodingStandard.ControlStructures.RequireNullCoalesceEqualOperator
- SlevomatCodingStandard.ControlStructures.RequireNullSafeObjectOperator
- SlevomatCodingStandard.Functions.StaticClosure
- SlevomatCodingStandard.Operators.DisallowEqualOperators
- SlevomatCodingStandard.Operators.RequireOnlyStandaloneIncrementAndDecrementOperators
Expand All @@ -122,9 +121,6 @@ Excluded sniffs:

#### Cleaning

- SlevomatCodingStandard.Classes.UnusedPrivateElements
- alwaysUsedPropertiesAnnotations: false
- alwaysUsedPropertiesSuffixes: false
- SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure
- SlevomatCodingStandard.Functions.UselessParameterDefaultValue
- SlevomatCodingStandard.Namespaces.UnusedUses
Expand All @@ -144,6 +140,7 @@ Excluded sniffs:
- ignoreUnusedValuesWhenOnlyKeysAreUsedInForeach: true
- SlevomatCodingStandard.Variables.UselessVariable
- SlevomatCodingStandard.Exceptions.DeadCatch
- SlevomatCodingStandard.Exceptions.RequireNonCapturingCatch

Excluded sniffs:

Expand Down Expand Up @@ -171,14 +168,16 @@ Excluded sniffs:
- linesCountBeforeFirstControlStructure: 0
- linesCountAfterControlStructure: 1
- linesCountAfterLastControlStructure: 0
- tokensToCheck: [T_SWITCH, T_TRY, T_IF, T_FOR, T_FOREACH, T_WHILE]
- controlStructures: [switch, try, if, for, foreach, while]
- SlevomatCodingStandard.ControlStructures.JumpStatementsSpacing
- allowSingleLineYieldStacking: whether or not to allow multiple yield/yield from statements in a row without blank lines.
- linesCountBeforeControlStructure: 1
- linesCountBeforeFirstControlStructure: 0
- linesCountAfterControlStructure: 0
- linesCountAfterLastControlStructure: 0
- tokensToCheck: default
- linesCountBefore: 1
- linesCountBeforeFirst: 0
- linesCountAfter: 0
- linesCountAfterLast: 0
- linesCountAfterWhenLastInCaseOrDefault: 0
- linesCountAfterWhenLastInLastCaseOrDefault: 0
- jumpStatements: [goto, throw, yield, continue, break, return]
- SlevomatCodingStandard.ControlStructures.LanguageConstructWithParentheses
- SlevomatCodingStandard.ControlStructures.NewWithParentheses
- SlevomatCodingStandard.ControlStructures.RequireMultiLineTernaryOperator
Expand All @@ -188,7 +187,8 @@ Excluded sniffs:
- ignoreMultiLine: false
- SlevomatCodingStandard.ControlStructures.DisallowYodaComparison
- SlevomatCodingStandard.Functions.DisallowArrowFunction
- SlevomatCodingStandard.Functions.TrailingCommaInCall
- SlevomatCodingStandard.Functions.RequireTrailingCommaInCall
- SlevomatCodingStandard.Functions.RequireTrailingCommaInDeclaration
- SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses
- psr12Compatible: true
- caseSensitive: true
Expand Down Expand Up @@ -220,9 +220,11 @@ Excluded sniffs:
- SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue
- SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing
- SlevomatCodingStandard.TypeHints.PropertyTypeHintSpacing
- SlevomatCodingStandard.TypeHints.UnionTypeHintFormat
- withSpaces: no
- shortNullable: yes
- nullPosition: last
- SlevomatCodingStandard.Namespaces.DisallowGroupUse
- SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameAfterKeyword
- keywordsToCheck: T_EXTENDS, T_IMPLEMENETS, T_USE, T_NEW, T_THROW
- SlevomatCodingStandard.Namespaces.FullyQualifiedExceptions
- specialExceptionNames: false
- ignoredNames: default
Expand All @@ -237,6 +239,7 @@ Excluded sniffs:
- SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation
- SlevomatCodingStandard.Commenting.ForbiddenAnnotations
- forbiddenAnnotations: @author, @created, @version, @package, @copyright, @license, @throws
- SlevomatCodingStandard.Classes.RequireConstructorPropertyPromotion
- SlevomatCodingStandard.Commenting.EmptyComment
- SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration
- SlevomatCodingStandard.Commenting.UselessFunctionDocComment
Expand Down

0 comments on commit 109bcf1

Please sign in to comment.