| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 8 |
| 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('The key content for dictionary %s must be set.', $name)); |
||
| 26 | } |
||
| 27 | |||
| 28 | $content = $config['content']; |
||
| 29 | $values = []; |
||
| 30 | 2 | ||
| 31 | foreach ($content as $value) { |
||
| 32 | 2 | $builtValue = $this->valueTransformer->transform($value); |
|
| 33 | 1 | $values[$builtValue] = $builtValue; |
|
| 34 | } |
||
| 35 | |||
| 36 | 1 | return new Simple($name, $values); |
|
| 37 | 1 | } |
|
| 44 |