67 final public function check($value)
81 return call_user_func($this->is_ok, $value);
106 if ($problem !==
null) {
107 $error = $this->data_factory->error($problem);
An exception for terminatinating execution or to throw for unit testing.
check($value)
Checks the provided value.Should not throw if accepts($value).UnexpectedValueException if value does ...
accepts($value)
Tells if the provided value complies.bool
applyTo(Result $result)
Restricts a Result.Must do nothing with the result if $result->isError(). Must replace the result wit...
problemWith($value)
Tells what the problem with the provided value is.Should return null if accepts($value)....
__construct(callable $is_ok, $error, Data\Factory $data_factory, \ilLanguage $lng)
If $error is a callable it needs to take two parameters:
error($a_errmsg)
set error message @access public
A result encapsulates a value or an error and simplifies the handling of those.
value()
Get the encapsulated value.
A constraint encodes some resrtictions on values.
getErrorMessage($value)
Get the problem message.
trait DeriveTransformFromApplyTo
trait DeriveInvokeFromTransform