| 1 | <?php |
||
| 8 | class TapMutator extends Mutator |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * Invokes $callback with the wrapped value of collection as the first argument |
||
| 12 | * and then wraps it back. |
||
| 13 | * |
||
| 14 | * The purpose of this Mutator |
||
| 15 | * is to "tap into" a Mutator |
||
| 16 | * chain in order to |
||
| 17 | * perform operations on intermediate results within the chain. |
||
| 18 | * |
||
| 19 | * @param Collection $collection |
||
| 20 | * @param callable $iterator |
||
| 21 | * @return Collection |
||
| 22 | */ |
||
| 23 | 1 | public function __invoke($collection, $iterator) |
|
| 29 | } |
||
| 30 |