ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Transformation.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Refinery\Custom;
22
23use ILIAS\Refinery\Transformation as TransformationInterface;
26
30class Transformation implements TransformationInterface
31{
34
37
38 public function __construct(callable $transformation)
39 {
40 $this->transformation = $transformation;
41 }
42
46 public function transform($from)
47 {
48 return call_user_func($this->transformation, $from);
49 }
50}
Transform values according to custom configuration.
__construct(callable $transformation)
A transformation is a function from one datatype to another.