Skip to content

Commit a8ced5c

Browse files
committed
Disable TypeHints.ParameterTypeHint.MissingNativeTypeHint
1 parent 41ab5c4 commit a8ced5c

File tree

5 files changed

+5
-15
lines changed

5 files changed

+5
-15
lines changed

IxDFCodingStandard/Sniffs/Classes/ForbidDirectClassInheritanceSniff.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@ public function register(): array
2424
];
2525
}
2626

27-
/**
28-
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
29-
* @param int $classPointer
30-
*/
27+
/** @param int $classPointer */
3128
public function process(File $phpcsFile, $classPointer): void
3229
{
3330
$parentFQCN = $phpcsFile->findExtendedClassName($classPointer);

IxDFCodingStandard/Sniffs/Classes/ForbidMethodDeclarationSniff.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ public function register(): array
2525
];
2626
}
2727

28-
/**
29-
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
30-
* @param int $classPointer
31-
*/
28+
/** @param int $classPointer */
3229
public function process(File $phpcsFile, $classPointer): void
3330
{
3431
/** @var class-string $fqcn */

IxDFCodingStandard/Sniffs/Laravel/RequireCustomAbortMessageSniff.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ public function register(): array
2929
return [\T_STRING];
3030
}
3131

32-
/**
33-
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
34-
* @param int $functionPointer
35-
*/
32+
/** @param int $functionPointer */
3633
public function process(File $phpcsFile, $functionPointer): void // phpcs:ignore Generic.Metrics.CyclomaticComplexity.MaxExceeded, SlevomatCodingStandard.Functions.FunctionLength.FunctionLength, SlevomatCodingStandard.Files.FunctionLength.FunctionLength, SlevomatCodingStandard.Complexity.Cognitive.ComplexityTooHigh
3734
{
3835
$tokens = $phpcsFile->getTokens();

IxDFCodingStandard/Sniffs/NamingConventions/MeaningfulVariableNameSniff.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ final class MeaningfulVariableNameSniff extends AbstractVariableSniff
1818
* Processes this test, when one of its tokens is encountered.
1919
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
2020
* @param int|string $stackPtr The position of the current token in the stack passed in $tokens.
21-
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
2221
*/
2322
protected function processVariable(File $phpcsFile, $stackPtr): void
2423
{
@@ -36,7 +35,6 @@ protected function processVariable(File $phpcsFile, $stackPtr): void
3635
* Processes class member variables.
3736
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
3837
* @param int|string $stackPtr The position of the current token in the stack passed in $tokens.
39-
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
4038
*/
4139
protected function processMemberVar(File $phpcsFile, $stackPtr): void
4240
{
@@ -54,7 +52,6 @@ protected function processMemberVar(File $phpcsFile, $stackPtr): void
5452
* Processes the variable found within a double-quoted string.
5553
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
5654
* @param int|string $stackPtr The position of the double-quoted string.
57-
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
5855
*/
5956
protected function processVariableInString(File $phpcsFile, $stackPtr): void // phpcs:ignore SlevomatCodingStandard.Complexity.Cognitive.ComplexityTooHigh
6057
{

IxDFCodingStandard/ruleset.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,8 @@
374374
<rule ref="SlevomatCodingStandard.TypeHints.NullTypeHintOnLastPosition"/>
375375
<rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue"/>
376376
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint">
377+
<!-- Native type hints may break inheritance -->
378+
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint"/>
377379
<properties>
378380
<property name="traversableTypeHints" type="array">
379381
<element value="\Illuminate\Database\Eloquent\Collection"/>

0 commit comments

Comments
 (0)