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;
22
24use InvalidArgumentException;
25
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:29
A transformation is a function from one datatype to another.
__invoke($from)
Transformations should be callable.
transform($from)
Perform the transformation.
applyTo(Result $result)
Perform the transformation and reify possible failures.