| Conditions | 2 | 
| Paths | 1 | 
| Total Lines | 18 | 
| Code Lines | 9 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 0 | ||
| 1 | <?php | ||
| 27 | private function waterfall (array $tasks, array $args) | ||
| 28 |     { | ||
| 29 | $index = 0; | ||
| 30 | |||
| 31 |         $next = function () use (&$index, &$tasks, &$next, &$args) { | ||
| 32 |             if ($index == count($tasks)) {  | ||
| 33 | return; | ||
| 34 | } | ||
| 35 | |||
| 36 |             $callback = $this->callOnce(function () use (&$next) { | ||
| 37 | $next(); | ||
| 38 | }); | ||
| 39 | |||
| 40 | $tasks[$index++]($callback, ...$args); | ||
| 41 | }; | ||
| 42 | |||
| 43 | $next(); | ||
| 44 | } | ||
| 45 | } |