| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 38 | 3 | public function create(array $config) |
|
| 39 | { |
||
| 40 | 3 | if (!isset($config['nodes'])) { |
|
| 41 | 1 | throw new InvalidArgumentException('config: [nodes] is mandatory'); |
|
| 42 | } |
||
| 43 | |||
| 44 | 2 | if (!isset($config['environments'])) { |
|
| 45 | 1 | throw new InvalidArgumentException('config: [environments] is mandatory'); |
|
| 46 | } |
||
| 47 | |||
| 48 | 1 | $nodes = $this->nodeFactory->create($config['nodes']); |
|
| 49 | 1 | $environments = $this->envFactory->create($config['environments'], $nodes); |
|
| 50 | |||
| 51 | 1 | $infrastructure = new Infrastructure(); |
|
| 52 | 1 | $infrastructure->addEnvironments($environments); |
|
| 53 | |||
| 54 | 1 | return $infrastructure; |
|
| 55 | } |
||
| 56 | } |
||
| 57 |