25 public function transform($from)
29 if (
true === $result->
isError()) {
30 $error = $result->
error();
36 throw new \Exception($error);
38 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.