Skip to content

Commit

Permalink
Slevomat Coding Standard 6.x
Browse files Browse the repository at this point in the history
  • Loading branch information
VasekPurchart committed Dec 17, 2019
1 parent 8fc0507 commit 13d9678
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 8 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
7 changes: 6 additions & 1 deletion build/cs-ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration">
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint">
<properties>
<property name="enableObjectTypeHint" value="false"/><!-- requires 7.2+ -->
</properties>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint">
<properties>
<property name="enableObjectTypeHint" value="false"/><!-- requires 7.2+ -->
</properties>
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.1",
"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 13d9678

Please sign in to comment.