| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 49 | 8 | public function getDecoratedProcesses() |
|
| 50 | { |
||
| 51 | 8 | $processes = $this->getProcesses(); |
|
| 52 | 8 | $numberOfProcesses = count($processes); |
|
| 53 | 8 | if ($numberOfProcesses === 0) { |
|
| 54 | 1 | throw new \RuntimeException('You must have at least one process to run'); |
|
| 55 | } |
||
| 56 | |||
| 57 | 7 | $decoratedProcesses = []; |
|
| 58 | 7 | $next = null; |
|
| 59 | |||
| 60 | 7 | for ($i = $numberOfProcesses - 1; $i >= 0; --$i) { |
|
| 61 | 7 | $decoratedProcesses[$i] = $next = $this->decoratorFactory->decorate($processes[$i], $next); |
|
| 62 | 7 | } |
|
| 63 | |||
| 64 | 7 | return $decoratedProcesses; |
|
| 65 | } |
||
| 66 | } |
||
| 67 |