| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 8 |
| 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('The key content for dictionary %s must be set.', $name)); |
|
| 34 | } |
||
| 35 | |||
| 36 | 1 | $content = $config['content']; |
|
| 37 | 1 | $values = []; |
|
| 38 | |||
| 39 | 1 | foreach ($content as $value) { |
|
| 40 | 1 | $builtValue = $this->transformer->transform($value); |
|
| 41 | 1 | $values[$builtValue] = $builtValue; |
|
| 42 | } |
||
| 43 | |||
| 44 | 1 | return new Simple($name, $values); |
|
| 45 | } |
||
| 52 |