From ba6dc1b645404a8ca9b6fae00a59cddee379810b Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Wed, 13 Mar 2024 12:02:41 +0100 Subject: [PATCH] Add more precise types for the prophesize method This matches the type used in Prophecy as the method is forwarded to it. --- src/ProphecyTrait.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ProphecyTrait.php b/src/ProphecyTrait.php index 7c9ada2..db1676f 100644 --- a/src/ProphecyTrait.php +++ b/src/ProphecyTrait.php @@ -36,7 +36,10 @@ trait ProphecyTrait * @throws DoubleException * @throws InterfaceNotFoundException * - * @psalm-param class-string|null $classOrInterface + * @template T of object + * @phpstan-param class-string|null $classOrInterface + * @phpstan-return ($classOrInterface is null ? ObjectProphecy : ObjectProphecy) + * * @not-deprecated */ protected function prophesize(?string $classOrInterface = null): ObjectProphecy