From 14e004ab50c4f7dbece807e9675bc1c99bf694a2 Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Mon, 23 Jul 2018 21:11:55 +0200 Subject: [PATCH] Fixed ObjectProphecyMethodReflection - parameters and return type are no longer part of MethodReflection --- .../ObjectProphecyMethodReflection.php | 28 ++++--------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/src/Reflection/ObjectProphecyMethodReflection.php b/src/Reflection/ObjectProphecyMethodReflection.php index 5c7c292..e761322 100644 --- a/src/Reflection/ObjectProphecyMethodReflection.php +++ b/src/Reflection/ObjectProphecyMethodReflection.php @@ -3,12 +3,10 @@ namespace JanGregor\Prophecy\Reflection; use PHPStan\Reflection\ClassReflection; +use PHPStan\Reflection\FunctionVariant; use PHPStan\Reflection\MethodReflection; use PHPStan\Reflection\ClassMemberReflection; -use PHPStan\Reflection\ParameterReflection; -use PHPStan\Reflection\TrivialParametersAcceptor; use PHPStan\Type\ObjectType; -use PHPStan\Type\Type; use Prophecy\Prophecy\MethodProphecy; class ObjectProphecyMethodReflection implements MethodReflection @@ -57,28 +55,14 @@ public function getName(): string public function getVariants(): array { return [ - new TrivialParametersAcceptor(), + new FunctionVariant( + [], + true, + new ObjectType(MethodProphecy::class) + ), ]; } - /** - * @return ParameterReflection[] - */ - public function getParameters(): array - { - return []; - } - - public function isVariadic(): bool - { - return true; - } - - public function getReturnType(): Type - { - return new ObjectType(MethodProphecy::class); - } - public function getPrototype(): ClassMemberReflection { return $this;