diff --git a/src/PhpDoc/ObjectProphecy/TypeNodeResolverExtension.php b/src/PhpDoc/ObjectProphecy/TypeNodeResolverExtension.php index 675f22e..c51801a 100644 --- a/src/PhpDoc/ObjectProphecy/TypeNodeResolverExtension.php +++ b/src/PhpDoc/ObjectProphecy/TypeNodeResolverExtension.php @@ -18,7 +18,6 @@ use PHPStan\PhpDocParser; use PHPStan\Type; use Prophecy\Prophecy; -use Prophecy\Prophecy\ObjectProphecy; /** * @internal @@ -65,7 +64,7 @@ public function resolve(PhpDocParser\Ast\Type\TypeNode $typeNode, Analyser\NameS } if (null !== $objectProphecyType && null !== $prophesizedType) { - return new Type\Generic\GenericObjectType(ObjectProphecy::class, [$prophesizedType]); + return new Type\Generic\GenericObjectType(Prophecy\ObjectProphecy::class, [$prophesizedType]); } } diff --git a/src/Type/ObjectProphecy/WillExtendOrImplementDynamicReturnTypeExtension.php b/src/Type/ObjectProphecy/WillExtendOrImplementDynamicReturnTypeExtension.php index f70678e..eedc0c3 100644 --- a/src/Type/ObjectProphecy/WillExtendOrImplementDynamicReturnTypeExtension.php +++ b/src/Type/ObjectProphecy/WillExtendOrImplementDynamicReturnTypeExtension.php @@ -18,8 +18,7 @@ use PHPStan\Reflection; use PHPStan\ShouldNotHappenException; use PHPStan\Type; -use PHPStan\Type\Generic\GenericObjectType; -use Prophecy\Prophecy\ObjectProphecy; +use Prophecy\Prophecy; /** * @internal @@ -56,7 +55,7 @@ public function getTypeFromMethodCall( $returnType = $parametersAcceptor->getReturnType(); - if (!$calledOnType instanceof Type\Generic\GenericObjectType || ObjectProphecy::class !== $calledOnType->getClassName()) { + if (!$calledOnType instanceof Type\Generic\GenericObjectType || Prophecy\ObjectProphecy::class !== $calledOnType->getClassName()) { return $returnType; } @@ -86,6 +85,6 @@ public function getTypeFromMethodCall( $mockTypeIntersection = Type\TypeCombinator::intersect(new Type\ObjectType($className), ...$calledOnType->getTypes()); - return new GenericObjectType(ObjectProphecy::class, [$mockTypeIntersection]); + return new Type\Generic\GenericObjectType(Prophecy\ObjectProphecy::class, [$mockTypeIntersection]); } } diff --git a/src/Type/Prophet/ProphesizeDynamicReturnTypeExtension.php b/src/Type/Prophet/ProphesizeDynamicReturnTypeExtension.php index 519f6f9..533ffb6 100644 --- a/src/Type/Prophet/ProphesizeDynamicReturnTypeExtension.php +++ b/src/Type/Prophet/ProphesizeDynamicReturnTypeExtension.php @@ -18,7 +18,7 @@ use PHPStan\Reflection; use PHPStan\ShouldNotHappenException; use PHPStan\Type; -use Prophecy\Prophecy\ObjectProphecy; +use Prophecy\Prophecy; /** * @internal @@ -52,7 +52,7 @@ public function getTypeFromMethodCall( $returnType = $parametersAcceptor->getReturnType(); if (0 === \count($methodCall->args)) { - return new Type\Generic\GenericObjectType(ObjectProphecy::class, []); + return new Type\Generic\GenericObjectType(Prophecy\ObjectProphecy::class, []); } $argumentType = $scope->getType($methodCall->args[0]->value); @@ -75,6 +75,6 @@ public function getTypeFromMethodCall( $className = $scope->getClassReflection()->getName(); } - return new Type\Generic\GenericObjectType(ObjectProphecy::class, [new Type\ObjectType($className)]); + return new Type\Generic\GenericObjectType(Prophecy\ObjectProphecy::class, [new Type\ObjectType($className)]); } }