Skip to content

Commit

Permalink
Don't warn about function argument type hint mismatches
Browse files Browse the repository at this point in the history
This is getting too complicated when used together with phpstan's
custom types, and phpstan can detect mismatches better anyway.
  • Loading branch information
pprkut committed Apr 12, 2024
1 parent 701488d commit 306005e
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions Lunr/Sniffs/Commenting/FunctionCommentSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,14 +417,6 @@ protected function processParams(File $phpcsFile, $stackPtr, $commentStart)
}

$phpcsFile->addError($error, $stackPtr, $errorCode, $data);
} else if ($typeHint !== $compareTypeHint && $typeHint !== '?'.$compareTypeHint) {
$error = 'Expected type hint "%s"; found "%s" for %s';
$data = [
$suggestedTypeHint,
$typeHint,
$param['var'],
];
$phpcsFile->addError($error, $stackPtr, 'IncorrectTypeHint', $data);
}//end if
} else if ($suggestedTypeHint === '' && isset($realParams[$pos]) === true) {
$typeHint = $realParams[$pos]['type_hint'];
Expand Down

0 comments on commit 306005e

Please sign in to comment.