Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | 5 | public function create(string $name, array $config): Dictionary |
|
23 | 5 | { |
|
24 | if (!isset($config['content'])) { |
||
25 | throw new \InvalidArgumentException(\sprintf( |
||
26 | 'The key content for dictionary %s must be set.', |
||
27 | $name |
||
28 | )); |
||
29 | } |
||
30 | 2 | ||
31 | $content = $config['content']; |
||
32 | 2 | $values = []; |
|
33 | 1 | ||
34 | 1 | foreach ($content as $value) { |
|
35 | $values[] = $this->valueTransformer->transform($value); |
||
36 | } |
||
37 | |||
38 | return new Simple($name, $values); |
||
39 | 1 | } |
|
46 |