Outcome
Rasuvaeff\Understudy\Outcome
Class — Package: rasuvaeff/understudy — Source — Version: v0.4.1
How one call ended: with a value or with a throwable. Kept as its own type because null is a perfectly valid return value and cannot double as "nothing was returned".
Constructor
php
__construct(
bool $returned,
mixed $value,
?Throwable $thrown,
)| Parameter | Type | Default | Description |
|---|---|---|---|
$returned | bool | required | |
$value | mixed | required | |
$thrown | ?Throwable | required |
Methods
returnedValue()
php
static returnedValue(mixed $value): selfthrownError()
php
static thrownError(Throwable $thrown): selfdidReturn()
php
didReturn(): booldidThrow()
php
didThrow(): boolreturned()
php
returned(non-empty-string $method): mixed$method— used only to render a helpful message
thrown()
php
thrown(): ?Throwable