Skip to content

Commit

Permalink
check PHPDoc and typehints declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
VasekPurchart committed Jun 19, 2018
1 parent 8e2c77b commit fb48c3d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Consistence/Sniffs/Exceptions/ExceptionDeclarationSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public function register(): array
}

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

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

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

/**
* @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint
* @codeCoverageIgnore
*
* @param \PHP_CodeSniffer\Files\File $file
Expand Down
8 changes: 8 additions & 0 deletions Consistence/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@
<rule ref="SlevomatCodingStandard.TypeHints.LongTypeHints"/>
<rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue"/>
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing"/>
<rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration">
<properties>
<property name="allAnnotationsAreUseful" value="true"/>
<property name="traversableTypeHints" type="array">
<element value="Traversable"/>
</property>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing"/>
<rule ref="SlevomatCodingStandard.Types.EmptyLinesAroundTypeBraces"/>
<rule ref="Squiz.Arrays.ArrayBracketSpacing">
Expand Down
5 changes: 5 additions & 0 deletions build/cs-ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@
"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration">
<properties>
<property name="enableObjectTypeHint" value="false"/><!-- requires 7.2+ -->
</properties>
</rule>
</ruleset>

0 comments on commit fb48c3d

Please sign in to comment.