From 9a1c97a04a71eb34a9fdd9dd1abd70ab9aecf4ce Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Fri, 6 Sep 2019 11:10:59 +0200 Subject: [PATCH] #3120 reverted `InvocationMocker#will() : self` - only works on PHP 7.4 I was too eager in using an appropriate type declaration on `InvocationMocker`, but that has to wait for newer PHP releases. --- .psalm/baseline.xml | 20 +++++++++++++++++++ .../MockObject/Builder/InvocationMocker.php | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.psalm/baseline.xml b/.psalm/baseline.xml index 809e61c6d83..cfe53c3c1dc 100644 --- a/.psalm/baseline.xml +++ b/.psalm/baseline.xml @@ -97,9 +97,29 @@ self + + $this->will($stub) + $this->will($stub) + $this->will($stub) + $this->will($stub) + $this->will($stub) + $this->will($stub) + $this->will($stub) + $this->will($stub) + InvocationMocker + + self + self + self + self + self + self + self + self + registerId diff --git a/src/Framework/MockObject/Builder/InvocationMocker.php b/src/Framework/MockObject/Builder/InvocationMocker.php index 914c730e9a7..48576615886 100644 --- a/src/Framework/MockObject/Builder/InvocationMocker.php +++ b/src/Framework/MockObject/Builder/InvocationMocker.php @@ -68,7 +68,7 @@ public function id($id): self return $this; } - public function will(Stub $stub): self + public function will(Stub $stub): Identity { $this->matcher->setStub($stub);