ILIAS
trunk Revision v11.0_alpha-2658-ge2404539063
◀ ilDoc Overview
ListTransformation.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\Refinery\KindlyTo\Transformation
;
22
23
use
ILIAS\Refinery\DeriveApplyToFromTransform
;
24
use
ILIAS\Refinery\DeriveInvokeFromTransform
;
25
use
ILIAS\Refinery\Transformation
;
26
27
class
ListTransformation
implements
Transformation
28
{
29
use
DeriveApplyToFromTransform
;
30
use
DeriveInvokeFromTransform
;
31
32
private
Transformation
$transformation
;
33
34
public
function
__construct
(
Transformation
$transformation)
35
{
36
$this->transformation =
$transformation
;
37
}
38
42
public
function
transform
($from): array
43
{
44
if
(!is_array($from)) {
45
$from = [$from];
46
}
47
48
$result = [];
49
foreach
($from as $val) {
50
$transformedVal = $this->transformation->transform($val);
51
$result[] = $transformedVal;
52
}
53
54
return
$result;
55
}
56
}
ILIAS\Refinery\DeriveInvokeFromTransform
trait DeriveInvokeFromTransform
Definition:
DeriveInvokeFromTransform.php:24
ILIAS\Refinery\DeriveApplyToFromTransform
trait DeriveApplyToFromTransform
Definition:
DeriveApplyToFromTransform.php:29
ILIAS\Refinery\KindlyTo\Transformation\ListTransformation
Definition:
ListTransformation.php:27
ILIAS\Refinery\KindlyTo\Transformation\ListTransformation\__construct
__construct(Transformation $transformation)
Definition:
ListTransformation.php:34
Transformation
ILIAS\Refinery\KindlyTo\Transformation\ListTransformation\$transformation
Transformation $transformation
Definition:
ListTransformation.php:32
ILIAS\Refinery\KindlyTo\Transformation\ListTransformation\transform
transform($from)
Definition:
ListTransformation.php:42
ILIAS\Refinery\Transformation
A transformation is a function from one datatype to another.
Definition:
Transformation.php:34
ILIAS\Refinery\KindlyTo\Transformation
Definition:
BooleanTransformation.php:21
components
ILIAS
Refinery
src
KindlyTo
Transformation
ListTransformation.php
Generated on Tue Sep 2 2025 23:03:38 for ILIAS by
1.8.13 (using
Doxyfile
)