Skip to content

Commit

Permalink
Slevomat Coding Standard 6.x
Browse files Browse the repository at this point in the history
  • Loading branch information
kukulich committed Dec 17, 2019
1 parent 2bd7c02 commit 1d6dc1f
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function register(): array
}

/**
* @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
*
* @param \PHP_CodeSniffer\Files\File $phpcsFile
* @param int $classPointer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ValidVariableNameSniff extends \PHP_CodeSniffer\Sniffs\AbstractVariableSni
];

/**
* @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
*
* @param \PHP_CodeSniffer\Files\File $file
* @param int $stackPointer position of the double quoted string
Expand All @@ -53,7 +53,7 @@ protected function processVariable(PhpCsFile $file, $stackPointer): void
}

/**
* @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
* @codeCoverageIgnore
*
* @param \PHP_CodeSniffer\Files\File $file
Expand All @@ -65,7 +65,7 @@ protected function processMemberVar(PhpCsFile $file, $stackPointer): void
}

/**
* @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
* @codeCoverageIgnore
*
* @param \PHP_CodeSniffer\Files\File $file
Expand Down
26 changes: 24 additions & 2 deletions Consistence/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@
<rule ref="SlevomatCodingStandard.Commenting.EmptyComment"/>
<rule ref="SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration"/>
<rule ref="SlevomatCodingStandard.Commenting.RequireOneLinePropertyDocComment"/>
<rule ref="SlevomatCodingStandard.Commenting.UselessFunctionDocComment">
<properties>
<property name="traversableTypeHints" type="array">
<element value="Traversable"/>
</property>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Commenting.UselessInheritDocComment"/>
<rule ref="SlevomatCodingStandard.ControlStructures.DisallowEmpty"/>
<rule ref="SlevomatCodingStandard.ControlStructures.DisallowYodaComparison"/>
Expand Down Expand Up @@ -140,9 +147,24 @@
<rule ref="SlevomatCodingStandard.TypeHints.LongTypeHints"/>
<rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue"/>
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing"/>
<rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration">
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint">
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.UselessAnnotation"/>
<properties>
<property name="traversableTypeHints" type="array">
<element value="Traversable"/>
</property>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint">
<properties>
<property name="traversableTypeHints" type="array">
<element value="Traversable"/>
</property>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint">
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.UselessAnnotation"/>
<properties>
<property name="allAnnotationsAreUseful" value="true"/>
<property name="traversableTypeHints" type="array">
<element value="Traversable"/>
</property>
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"require": {
"php": "~7.2",
"squizlabs/php_codesniffer": "~3.5.0",
"slevomat/coding-standard": "~5.0"
"slevomat/coding-standard": "~6.0.0"
},
"require-dev": {
"jakub-onderka/php-console-highlighter": "0.4",
Expand Down

0 comments on commit 1d6dc1f

Please sign in to comment.