19 declare(strict_types=1);
36 public function transform($from)
40 if (
true === $result->
isError()) {
47 throw new Exception(
$error);
49 return $result->
value();
value()
Get the encapsulated value.
isError()
Get to know if the result is an error.
A result encapsulates a value or an error and simplifies the handling of those.
A result encapsulates a value or an error and simplifies the handling of those.
error()
Get the encapsulated error.