Skip to content

Commit

Permalink
#3120 reverted InvocationMocker#will() : self - only works on PHP 7.4
Browse files Browse the repository at this point in the history
I was too eager in using an appropriate type declaration on `InvocationMocker`,
but that has to wait for newer PHP releases.
  • Loading branch information
Ocramius authored and sebastianbergmann committed Sep 6, 2019
1 parent 21a9c6d commit 9a1c97a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions .psalm/baseline.xml
Expand Up @@ -97,9 +97,29 @@
<ImplementedReturnTypeMismatch occurrences="1">
<code>self</code>
</ImplementedReturnTypeMismatch>
<LessSpecificReturnStatement occurrences="8">
<code>$this-&gt;will($stub)</code>
<code>$this-&gt;will($stub)</code>
<code>$this-&gt;will($stub)</code>
<code>$this-&gt;will($stub)</code>
<code>$this-&gt;will($stub)</code>
<code>$this-&gt;will($stub)</code>
<code>$this-&gt;will($stub)</code>
<code>$this-&gt;will($stub)</code>
</LessSpecificReturnStatement>
<MethodSignatureMismatch occurrences="1">
<code>InvocationMocker</code>
</MethodSignatureMismatch>
<MoreSpecificReturnType occurrences="8">
<code>self</code>
<code>self</code>
<code>self</code>
<code>self</code>
<code>self</code>
<code>self</code>
<code>self</code>
<code>self</code>
</MoreSpecificReturnType>
<UndefinedInterfaceMethod occurrences="1">
<code>registerId</code>
</UndefinedInterfaceMethod>
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/MockObject/Builder/InvocationMocker.php
Expand Up @@ -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);

Expand Down

0 comments on commit 9a1c97a

Please sign in to comment.