| Conditions | 1 |
| Paths | 1 |
| Total Lines | 10 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | function stack(array $funcs) { |
||
| 21 | return array_reduce(array_reverse($funcs), function($next, $func) { |
||
| 22 | return function(...$args) use ($next, $func) { |
||
| 23 | $args[] = $next; |
||
| 24 | return $func(...$args); |
||
| 25 | }; |
||
| 26 | }, function() { |
||
| 27 | throw new ComposeException('No handler was able to return a result.'); |
||
| 28 | }); |
||
| 29 | } |
||
| 30 | |||
| 56 | } |