ILIAS  release_7 Revision v7.30-3-g800a261c036
Transformation.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 2017 Stefan Hecken <stefan.hecken@concepts-and-training.de> Extended GPL, see docs/LICENSE */
3
5
8use ILIAS\Refinery\Transformation as TransformationInterface;
11
15class Transformation implements TransformationInterface
16{
19
23 protected $transform;
24 private $factory;
25
30 public function __construct(callable $transform, Factory $factory)
31 {
32 $this->transform = $transform;
33 $this->factory = $factory;
34 }
35
39 public function transform($from)
40 {
41 return call_user_func($this->transform, $from);
42 }
43}
An exception for terminatinating execution or to throw for unit testing.
Builds data types.
Definition: Factory.php:20
Transform values according to custom configuration.
__construct(callable $transform, Factory $factory)
transform($from)
Perform the transformation.Please use this for transformations. It's more performant than calling inv...
A transformation is a function from one datatype to another.