Conditions | 3 |
Paths | 3 |
Total Lines | 24 |
Lines | 0 |
Ratio | 0 % |
Tests | 14 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
32 | 3 | private function invokeNext(PipelineStageContextInterface $context, $currentIndex) |
|
33 | { |
||
34 | 3 | if ($currentIndex == count($this->stepList)) { |
|
35 | 3 | return; |
|
36 | } |
||
37 | |||
38 | 2 | $step = $this->stepList[$currentIndex]; |
|
39 | |||
40 | 2 | if ($step instanceof StageConnectorInterface) { |
|
41 | 1 | $step->invoke( |
|
42 | 1 | $context, |
|
43 | function ($newContext) use ($currentIndex) { |
||
44 | 1 | $this->invokeNext($newContext, $currentIndex + 1); |
|
45 | 1 | } |
|
46 | ); |
||
47 | } else { |
||
48 | 2 | $step->invoke( |
|
49 | 2 | $context, |
|
50 | function () use ($context, $currentIndex) { |
||
51 | 2 | $this->invokeNext($context, $currentIndex + 1); |
|
52 | 2 | } |
|
53 | ); |
||
54 | } |
||
55 | 2 | } |
|
56 | } |
||
57 |