| 1 | <?php |
||
| 15 | class Callback implements TransformerInterface |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * Transforming method. |
||
| 19 | * |
||
| 20 | * @param callable |
||
| 21 | */ |
||
| 22 | private $transform; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Reversing method. |
||
| 26 | * |
||
| 27 | * @param callable |
||
| 28 | */ |
||
| 29 | private $reverse; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Constructor. |
||
| 33 | * |
||
| 34 | * @param callable $transform |
||
| 35 | * @param callable $reverse |
||
| 36 | */ |
||
| 37 | public function __construct(callable $transform, callable $reverse) |
||
| 42 | |||
| 43 | /** |
||
| 44 | * {@inheritdoc} |
||
| 45 | */ |
||
| 46 | 1 | public function transform($value, $context) |
|
| 50 | |||
| 51 | /** |
||
| 52 | * {@inheritdoc} |
||
| 53 | */ |
||
| 54 | 1 | public function reverse($value, $context) |
|
| 58 | } |
||
| 59 |