Conditions | 6 |
Paths | 4 |
Total Lines | 20 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 14 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
31 | 1 | protected function constructEnvironment($environmentConfig, $nodes) |
|
32 | { |
||
33 | // Replace node names with node instances |
||
34 | 1 | if (isset($environmentConfig['nodes'])) { |
|
35 | 1 | foreach ($environmentConfig['nodes'] as $i => $nodeName) { |
|
36 | 1 | $environmentConfig['nodes'][$i] = $nodes[$nodeName]; |
|
37 | 1 | } |
|
38 | 1 | } |
|
39 | |||
40 | // Replace node names with node instances |
||
41 | 1 | if (isset($environmentConfig['roles'])) { |
|
42 | 1 | foreach ($environmentConfig['roles'] as $role => $nodeNames) { |
|
43 | 1 | foreach ($nodeNames as $i => $nodeName) { |
|
44 | 1 | $environmentConfig['roles'][$role][$i] = $nodes[$nodeName]; |
|
45 | 1 | } |
|
46 | 1 | } |
|
47 | 1 | } |
|
48 | |||
49 | 1 | return new Environment($environmentConfig); |
|
50 | } |
||
51 | } |
||
52 |