ILIAS
release_6 Revision v6.24-5-g0c8bfefb3b8
|
Adds to any array keys for each value. More...
Public Member Functions | ||||||
__construct (array $labels, Factory $factory) | ||||||
transform ($from) | ||||||
Perform the transformation.Please use this for transformations. It's more performant than calling invoke.
InvalidArgumentException if the argument could not be transformed
| ||||||
__invoke ($from) | ||||||
Transformations should be callable.This MUST do the same as transform.
InvalidArgumentException if the argument could not be transformed
| ||||||
applyTo (Result $data) | ||||||
Perform the transformation and reify possible failures.If $data->isError() , the method MUST do nothing. It MUST transform the value in $data like it would transform $data provided to transform . It must reify every exception thrown in this process by returning a Result that isError() and contains the exception that happened.If you simply need to implement a transformation you most probably want to implement transform and derive this via the trait DeriveTransformationInterface .If you simply want to call the transformation, you most probably want to use transform , since it simply throws exceptions that occurred while doing the transformation.If you are implementing some entity that performs processing of input data at some boundary, the reification of exceptions might help you to write cleaner code.
| ||||||
transform ($from) | ||||||
Perform the transformation. More... | ||||||
applyTo (Result $data) | ||||||
Perform the transformation and reify possible failures. More... | ||||||
__invoke ($from) | ||||||
Transformations should be callable. More... | ||||||
Protected Attributes | |
$labels | |
Private Attributes | |
$factory | |
Adds to any array keys for each value.
Definition at line 13 of file AddLabels.php.
ILIAS\Refinery\Container\AddLabels::__construct | ( | array | $labels, |
Factory | $factory | ||
) |
string[] | int[] | $labels | |
Factory | null | $factory |
Definition at line 29 of file AddLabels.php.
References ILIAS\Refinery\Container\AddLabels\$factory, and ILIAS\Refinery\Container\AddLabels\$labels.
ILIAS\Refinery\Container\AddLabels::__invoke | ( | $from | ) |
Transformations should be callable.This MUST do the same as transform.
InvalidArgumentException if the argument could not be transformed
mixed | $from |
Implements ILIAS\Refinery\Transformation.
Definition at line 54 of file AddLabels.php.
References ILIAS\Refinery\Container\AddLabels\transform().
ILIAS\Refinery\Container\AddLabels::applyTo | ( | Result | $data | ) |
Perform the transformation and reify possible failures.If $data->isError()
, the method MUST do nothing. It MUST transform the value in $data
like it would transform $data provided to transform
. It must reify every exception thrown in this process by returning a Result
that isError()
and contains the exception that happened.If you simply need to implement a transformation you most probably want to implement transform and derive this via the trait DeriveTransformationInterface
.If you simply want to call the transformation, you most probably want to use transform
, since it simply throws exceptions that occurred while doing the transformation.If you are implementing some entity that performs processing of input data at some boundary, the reification of exceptions might help you to write cleaner code.
Result | $data |
Implements ILIAS\Refinery\Transformation.
Definition at line 62 of file AddLabels.php.
ILIAS\Refinery\Container\AddLabels::transform | ( | $from | ) |
Perform the transformation.Please use this for transformations. It's more performant than calling invoke.
InvalidArgumentException if the argument could not be transformed
mixed | $from |
Implements ILIAS\Refinery\Transformation.
Definition at line 38 of file AddLabels.php.
Referenced by ILIAS\Refinery\Container\AddLabels\__invoke().
|
private |
Definition at line 23 of file AddLabels.php.
Referenced by ILIAS\Refinery\Container\AddLabels\__construct().
|
protected |
Definition at line 18 of file AddLabels.php.
Referenced by ILIAS\Refinery\Container\AddLabels\__construct().