diff --git a/rules/DowngradePhp71/TypeDeclaration/PhpDocFromTypeDeclarationDecorator.php b/rules/DowngradePhp71/TypeDeclaration/PhpDocFromTypeDeclarationDecorator.php index 5189fcdd132..e6766e9972d 100644 --- a/rules/DowngradePhp71/TypeDeclaration/PhpDocFromTypeDeclarationDecorator.php +++ b/rules/DowngradePhp71/TypeDeclaration/PhpDocFromTypeDeclarationDecorator.php @@ -127,12 +127,6 @@ private function moveParamTypeToParamDoc( */ private function isMatchingType(Type $type, array $requiredTypes): bool { - foreach ($requiredTypes as $requiredType) { - if (is_a($type, $requiredType, true)) { - return true; - } - } - - return false; + return in_array($type::class, $requiredTypes, true); } }