Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
30 | 2 | public function create(string $name, array $config): Dictionary |
|
31 | { |
||
32 | 2 | if (!isset($config['content'])) { |
|
33 | 1 | throw new InvalidArgumentException(sprintf( |
|
34 | 1 | 'The key content for dictionary %s must be set.', |
|
35 | $name |
||
36 | )); |
||
37 | } |
||
38 | |||
39 | 1 | $content = $config['content']; |
|
40 | 1 | $values = []; |
|
41 | |||
42 | 1 | foreach ($content as $value) { |
|
43 | 1 | $values[] = $this->transformer->transform($value); |
|
44 | } |
||
45 | |||
46 | 1 | return new Simple($name, $values); |
|
47 | } |
||
54 |