From 306005eaee216f3e4c06a81a3a2c2491841ee2e0 Mon Sep 17 00:00:00 2001 From: Heinz Wiesinger Date: Fri, 12 Apr 2024 13:23:58 +0200 Subject: [PATCH] Don't warn about function argument type hint mismatches This is getting too complicated when used together with phpstan's custom types, and phpstan can detect mismatches better anyway. --- Lunr/Sniffs/Commenting/FunctionCommentSniff.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Lunr/Sniffs/Commenting/FunctionCommentSniff.php b/Lunr/Sniffs/Commenting/FunctionCommentSniff.php index ebe35ca..697a633 100644 --- a/Lunr/Sniffs/Commenting/FunctionCommentSniff.php +++ b/Lunr/Sniffs/Commenting/FunctionCommentSniff.php @@ -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'];