ILIAS  release_7 Revision v7.30-3-g800a261c036
ILIAS\Refinery\In\Series Class Reference
+ Inheritance diagram for ILIAS\Refinery\In\Series:
+ Collaboration diagram for ILIAS\Refinery\In\Series:

Public Member Functions

 __construct (array $transformations)
 
 transform ($from)
 Perform the transformation.Please use this for transformations. It's more performant than calling invoke.
Exceptions

InvalidArgumentException if the argument could not be transformed

Parameters
mixed$from
Returns
mixed
More...
 
- Public Member Functions inherited from ILIAS\Refinery\Transformation
 transform ($from)
 Perform the transformation. More...
 
 applyTo (Result $data)
 Perform the transformation and reify possible failures. More...
 
 __invoke ($from)
 Transformations should be callable. More...
 

Private Attributes

 $transformationStrategies
 

Detailed Description

Definition at line 17 of file Series.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Refinery\In\Series::__construct ( array  $transformations)
Parameters
array$transformations

Definition at line 30 of file Series.php.

31 {
32 foreach ($transformations as $transformation) {
33 if (!$transformation instanceof Transformation) {
34 $transformationClassName = Transformation::class;
35
36 throw new ConstraintViolationException(
37 sprintf('The array MUST contain only "%s" instances', $transformationClassName),
38 'not_a_transformation',
39 $transformationClassName
40 );
41 }
42 }
43 $this->transformationStrategies = $transformations;
44 }

Member Function Documentation

◆ transform()

ILIAS\Refinery\In\Series::transform (   $from)

Perform the transformation.Please use this for transformations. It's more performant than calling invoke.

Exceptions

InvalidArgumentException if the argument could not be transformed

Parameters
mixed$from
Returns
mixed

Implements ILIAS\Refinery\Transformation.

Definition at line 49 of file Series.php.

50 {
51 $result = $from;
52 foreach ($this->transformationStrategies as $strategy) {
53 $result = $strategy->transform($result);
54 }
55
56 return $result;
57 }
$result

References $result.

Field Documentation

◆ $transformationStrategies

ILIAS\Refinery\In\Series::$transformationStrategies
private

Definition at line 25 of file Series.php.


The documentation for this class was generated from the following file: