ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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 
4 namespace ILIAS\Refinery\Custom;
5 
10 
15 {
17 
21  protected $transform;
22  private $factory;
23 
28  public function __construct(callable $transform, Factory $factory)
29  {
30  $this->transform = $transform;
31  $this->factory = $factory;
32  }
33 
37  public function transform($from)
38  {
39  return call_user_func($this->transform, $from);
40  }
41 
45  public function __invoke($from)
46  {
47  return $this->transform($from);
48  }
49 }
__invoke($from)
Transformations should be callable.This MUST do the same as transform.
Transform values according to custom configuration.
__construct(callable $transform, Factory $factory)
transform($from)
Perform the transformation.Please use this for transformations. It&#39;s more performant than calling inv...
Builds data types.
Definition: Factory.php:19