ILIAS
release_6 Revision v6.24-5-g0c8bfefb3b8
|
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.
| ||||
__invoke ($from) | ||||
Transformations should be callable.This MUST do the same as transform.
| ||||
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.
| ||||
Protected Attributes | |
$delimiter | |
Private Attributes | |
$factory | |
Split a string by delimiter into array.
Definition at line 13 of file SplitString.php.
ILIAS\Refinery\String\SplitString::__construct | ( | $delimiter, | |
Factory | $factory | ||
) |
string | $delimiter | |
Factory | $factory |
Definition at line 29 of file SplitString.php.
References ILIAS\Refinery\String\SplitString\$delimiter, and ILIAS\Refinery\String\SplitString\$factory.
ILIAS\Refinery\String\SplitString::__invoke | ( | $from | ) |
Transformations should be callable.This MUST do the same as transform.
Implements ILIAS\Refinery\Transformation.
Definition at line 50 of file SplitString.php.
References ILIAS\Refinery\String\SplitString\transform().
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 58 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 38 of file SplitString.php.
Referenced by ILIAS\Refinery\String\SplitString\__invoke().
|
protected |
Definition at line 18 of file SplitString.php.
Referenced by ILIAS\Refinery\String\SplitString\__construct().
|
private |
Definition at line 23 of file SplitString.php.
Referenced by ILIAS\Refinery\String\SplitString\__construct().