From 508f656170edbe92d152656858b930cf280db098 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Fri, 6 Sep 2019 11:24:54 +0200 Subject: [PATCH] #3120 removing `self` types on `InvocationStubber`: requires PHP 7.4 Once we have PHP 7.4, we can move these type declarations into the interface signature again, but for now, the existing inheritance leads to a crash on PHP < 7.4. --- .../MockObject/Builder/InvocationStubber.php | 49 ++++++++++++++----- 1 file changed, 36 insertions(+), 13 deletions(-) diff --git a/src/Framework/MockObject/Builder/InvocationStubber.php b/src/Framework/MockObject/Builder/InvocationStubber.php index 4acfad9f4f1..82ed97f3d23 100644 --- a/src/Framework/MockObject/Builder/InvocationStubber.php +++ b/src/Framework/MockObject/Builder/InvocationStubber.php @@ -21,24 +21,47 @@ interface InvocationStubber */ public function will(Stub $stub): Identity; - public function willReturn($value, ...$nextValues): self; + /** @return self */ + public function willReturn($value, ...$nextValues); - /** @param mixed $reference */ - public function willReturnReference(&$reference): self; + /** + * @param mixed $reference + * + * @return self + */ + public function willReturnReference(&$reference); - /** @param array> $valueMap */ - public function willReturnMap(array $valueMap): self; + /** + * @param array> $valueMap + * + * @return self + */ + public function willReturnMap(array $valueMap); - /** @param int $argumentIndex */ - public function willReturnArgument($argumentIndex): self; + /** + * @param int $argumentIndex + * + * @return self + */ + public function willReturnArgument($argumentIndex); - /** @param callable $callback */ - public function willReturnCallback($callback): self; + /** + * @param callable $callback + * + * @return self + */ + public function willReturnCallback($callback); - public function willReturnSelf(): self; + /** @return self */ + public function willReturnSelf(); - /** @param mixed $values */ - public function willReturnOnConsecutiveCalls(...$values): self; + /** + * @param mixed $values + * + * @return self + */ + public function willReturnOnConsecutiveCalls(...$values); - public function willThrowException(\Throwable $exception): self; + /** @return self */ + public function willThrowException(\Throwable $exception); }