Skip to content

Commit fb48c3d

Browse files
committed
check PHPDoc and typehints declaration
1 parent 8e2c77b commit fb48c3d

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

Consistence/Sniffs/Exceptions/ExceptionDeclarationSniff.php

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ public function register(): array
3232
}
3333

3434
/**
35+
* @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint
36+
*
3537
* @param \PHP_CodeSniffer\Files\File $phpcsFile
3638
* @param int $classPointer
3739
*/

Consistence/Sniffs/NamingConventions/ValidVariableNameSniff.php

+4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ class ValidVariableNameSniff extends \PHP_CodeSniffer\Sniffs\AbstractVariableSni
2626
];
2727

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

5355
/**
56+
* @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint
5457
* @codeCoverageIgnore
5558
*
5659
* @param \PHP_CodeSniffer\Files\File $file
@@ -62,6 +65,7 @@ protected function processMemberVar(PhpCsFile $file, $stackPointer): void
6265
}
6366

6467
/**
68+
* @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint
6569
* @codeCoverageIgnore
6670
*
6771
* @param \PHP_CodeSniffer\Files\File $file

Consistence/ruleset.xml

+8
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,14 @@
137137
<rule ref="SlevomatCodingStandard.TypeHints.LongTypeHints"/>
138138
<rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue"/>
139139
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing"/>
140+
<rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration">
141+
<properties>
142+
<property name="allAnnotationsAreUseful" value="true"/>
143+
<property name="traversableTypeHints" type="array">
144+
<element value="Traversable"/>
145+
</property>
146+
</properties>
147+
</rule>
140148
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing"/>
141149
<rule ref="SlevomatCodingStandard.Types.EmptyLinesAroundTypeBraces"/>
142150
<rule ref="Squiz.Arrays.ArrayBracketSpacing">

build/cs-ruleset.xml

+5
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,9 @@
99
"/>
1010
</properties>
1111
</rule>
12+
<rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration">
13+
<properties>
14+
<property name="enableObjectTypeHint" value="false"/><!-- requires 7.2+ -->
15+
</properties>
16+
</rule>
1217
</ruleset>

0 commit comments

Comments
 (0)