ILIAS
release_7 Revision v7.30-3-g800a261c036
|
Split a string by delimiter into array. More...
Public Member Functions | ||||
__construct ($delimiter, Factory $factory) | ||||
transform ($from) | ||||
Perform the transformation.Please use this for transformations. It's more performant than calling invoke.
| ||||
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.
| ||||
![]() | ||||
__invoke ($from) | ||||
Transformations should be callable. More... | ||||
Protected Attributes | |
$delimiter | |
Private Attributes | |
$factory | |
Split a string by delimiter into array.
Definition at line 14 of file SplitString.php.
ILIAS\Refinery\String\SplitString::__construct | ( | $delimiter, | |
Factory | $factory | ||
) |
string | $delimiter | |
Factory | $factory |
Definition at line 32 of file SplitString.php.
References ILIAS\Refinery\String\SplitString\$delimiter, and ILIAS\Refinery\String\SplitString\$factory.
ILIAS\Refinery\String\SplitString::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 53 of file SplitString.php.
References ILIAS\Data\Result\value().
ILIAS\Refinery\String\SplitString::transform | ( | $from | ) |
Perform the transformation.Please use this for transformations. It's more performant than calling invoke.
Implements ILIAS\Refinery\Transformation.
Definition at line 41 of file SplitString.php.
|
protected |
Definition at line 21 of file SplitString.php.
Referenced by ILIAS\Refinery\String\SplitString\__construct().
|
private |
Definition at line 26 of file SplitString.php.
Referenced by ILIAS\Refinery\String\SplitString\__construct().