From 9b4d3adfbd42a0bcaed1d558621ba10af452e367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Mon, 8 Nov 2021 17:01:31 +0100 Subject: [PATCH] Fix: Split condition --- .../WillExtendOrImplementDynamicReturnTypeExtension.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Type/ObjectProphecy/WillExtendOrImplementDynamicReturnTypeExtension.php b/src/Type/ObjectProphecy/WillExtendOrImplementDynamicReturnTypeExtension.php index ea02908..ebfbed9 100644 --- a/src/Type/ObjectProphecy/WillExtendOrImplementDynamicReturnTypeExtension.php +++ b/src/Type/ObjectProphecy/WillExtendOrImplementDynamicReturnTypeExtension.php @@ -55,10 +55,11 @@ public function getTypeFromMethodCall( $returnType = $parametersAcceptor->getReturnType(); - if ( - !$calledOnType instanceof Type\Generic\GenericObjectType - || Prophecy\ObjectProphecy::class !== $calledOnType->getClassName() - ) { + if (!$calledOnType instanceof Type\Generic\GenericObjectType) { + return $returnType; + } + + if (Prophecy\ObjectProphecy::class !== $calledOnType->getClassName()) { return $returnType; }