55 throw new \LogicException(
"This is a OK result. No error message available");
69 public function map(callable
$f)
89 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
isOK()
Get to know if the result is ok.bool
A result encapsulates a value or an error and simplifies the handling of those.
isError()
Get to know if the result is an error.bool
except(callable $f)
Feed the error into a callable and replace this with the result or do nothing if this is a value...
A result encapsulates a value or an error and simplifies the handling of those.
error()
Get the encapsulated error.if isOK Exception|string
value()
Get the encapsulated value.if !isOK, will either throw the contained exception or a NotOKException if...
map(callable $f)
Create a new result where the contained value is modified with $f.Does nothing if !isOK...