ForgottenDouble
Rasuvaeff\Understudy\Exception\ForgottenDouble
Class — Package: rasuvaeff/understudy — Source — Version: v1.2.3-1-g736abde
Extends: LogicException
Implements: Throwable, Stringable, Exception\UnderstudyError
A double outlived the context that created it — almost always a double kept in a static property or a shared fixture across Understudy::reset().
Answering with null instead would violate the declared return type of any non-nullable method and surface far from the actual mistake.
Methods
afterReset()
static afterReset(non-empty-string $method): selfBuilds the error for calling a double after its context was reset.
afterScope()
static afterScope(non-empty-string $member): selfThe double was built inside Understudy::scope() and the scope has closed since. There is no reset() to look for.
$member— the method called on the double, or the facade verb it was handed to
onPurpose()
static onPurpose(non-empty-string $method): selfBuilds the error for calling a deliberately retired double.
propertyAfterReset()
static propertyAfterReset(non-empty-string $property): selfBuilds the error for reading a property after reset.
propertyAfterScope()
static propertyAfterScope(non-empty-string $property): selfBuilds the error for touching a property of a double built inside a Understudy::scope() that has closed since.
$property— the property that was read or written
propertyOnPurpose()
static propertyOnPurpose(non-empty-string $property): selfBuilds the error for touching a property of a deliberately retired double.
$property— the property that was read or written
retired()
static retired(): selfBuilds the error for asking a retired double through the facade.
A facade — strict(), verify(), nothingElse(), forget() itself — was asked about a double that Understudy::forget() retired.
fromDefaultFactory()
static fromDefaultFactory(class-string $contract): selfBuilds the error for a default factory returning a retired double.