ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
Transformation.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\Refinery;
22 
25 
34 interface Transformation
35 {
44  public function transform($from);
45 
65  public function applyTo(Result $result): Result;
66 
74  public function __invoke($from);
75 }
A result encapsulates a value or an error and simplifies the handling of those.
Definition: Result.php:14
transform($from)
Perform the transformation.
__invoke($from)
Transformations should be callable.
A transformation is a function from one datatype to another.
applyTo(Result $result)
Perform the transformation and reify possible failures.