19declare(strict_types=1);
40 if (
true === $result->
isError()) {
43 if (
$error instanceof Exception) {
47 throw new Exception(
$error);
49 return $result->
value();
A result encapsulates a value or an error and simplifies the handling of those.
trait DeriveTransformFromApplyTo
A result encapsulates a value or an error and simplifies the handling of those.
isError()
Get to know if the result is an error.
value()
Get the encapsulated value.
error()
Get the encapsulated error.
applyTo(Result $result)
@inheritDoc