3declare(strict_types=1);
36 public function transform($from)
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.
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.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
applyTo(Result $result)
@inheritDoc
trait DeriveTransformFromApplyTo