3 declare(strict_types=1);
17 class Error implements Data\Result
27 throw new \InvalidArgumentException(
"Expected error to be a string or an Exception.");
35 public function isOK(): bool
49 throw new Data\NotOKException($this->
error);
99 if ($result === null) {
104 throw new \UnexpectedValueException(
"The returned type of callable is not an instance of interface Result");
then(callable $f)
Get a new result from the callable or do nothing if this is an error.If null is returned from $f...
valueOr($default)
Get the encapsulated value or the supplied default if result is an error.mixed
map(callable $f)
Create a new result where the contained value is modified with $f.Does nothing if !isOK...
isError()
Get to know if the result is an error.
value()
Get the encapsulated value.mixed
isOK()
Get to know if the result is ok.
except(callable $f)
Feed the error into a callable and replace this with the result or do nothing if this is a value...
error()
Get the encapsulated error.|string
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...