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

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 16 of file Parallel.php.

Constructor & Destructor Documentation

◆ __construct()

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

InvalidArgumentException

Definition at line 30 of file Parallel.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\Parallel::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 Parallel.php.

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

References $results.

Field Documentation

◆ $transformationStrategies

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

Definition at line 24 of file Parallel.php.


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