From 94d479afc6e7b1b472c79395bbc662c94fe55212 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 5 Nov 2022 12:08:03 +0100 Subject: [PATCH] simplify --- src/Type/Php/MethodExistsTypeSpecifyingExtension.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Type/Php/MethodExistsTypeSpecifyingExtension.php b/src/Type/Php/MethodExistsTypeSpecifyingExtension.php index 83cf04943c5..473b4d5cffe 100644 --- a/src/Type/Php/MethodExistsTypeSpecifyingExtension.php +++ b/src/Type/Php/MethodExistsTypeSpecifyingExtension.php @@ -53,7 +53,7 @@ public function specifyTypes( } $objectType = $scope->getType($node->getArgs()[0]->value); - if (!$objectType instanceof ObjectType) { + if ($objectType->isString()->yes()) { if ($objectType instanceof ConstantStringType && $objectType->isClassString()) { return $this->typeSpecifier->create( $node->getArgs()[0]->value, @@ -66,9 +66,8 @@ public function specifyTypes( $scope, ); } - if ($objectType->isString()->yes()) { - return new SpecifiedTypes([], []); - } + + return new SpecifiedTypes([], []); } return $this->typeSpecifier->create(