ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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
More...
 
 __invoke ($from)
 Transformations should be callable.This MUST do the same as transform.
Exceptions
More...
 
- Public Member Functions inherited from ILIAS\Refinery\Transformation
 applyTo (Result $data)
 Perform the transformation and reify possible failures. More...
 

Private Attributes

 $transformationStrategies
 

Detailed Description

Definition at line 16 of file Series.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 27 of file Series.php.

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

Member Function Documentation

◆ __invoke()

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

Transformations should be callable.This MUST do the same as transform.

Exceptions

Implements ILIAS\Refinery\Transformation.

Definition at line 59 of file Series.php.

References ILIAS\Refinery\In\Series\transform().

60  {
61  return $this->transform($from);
62  }
transform($from)
Perform the transformation.Please use this for transformations. It's more performant than calling inv...
Definition: Series.php:46
+ Here is the call graph for this function:

◆ transform()

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

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

Exceptions

Implements ILIAS\Refinery\Transformation.

Definition at line 46 of file Series.php.

References $result.

Referenced by ILIAS\Refinery\In\Series\__invoke().

47  {
48  $result = $from;
49  foreach ($this->transformationStrategies as $strategy) {
50  $result = $strategy->transform($result);
51  }
52 
53  return $result;
54  }
$result
+ Here is the caller graph for this function:

Field Documentation

◆ $transformationStrategies

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

Definition at line 22 of file Series.php.


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