From c25405412147909dbc90b3fe12168e64837786ea Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Thu, 26 Aug 2021 19:07:11 +0700 Subject: [PATCH] [DowngradePhp71] Using exact same type on PhpDocFromTypeDeclarationDecorator::isMatchingType() (#772) --- .../PhpDocFromTypeDeclarationDecorator.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) 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); } }