Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
28 | 2 | public function create(string $name, array $config): Dictionary |
|
29 | { |
||
30 | 2 | foreach ($this->factories as $factory) { |
|
31 | 2 | if ($factory->supports($config)) { |
|
32 | 1 | return $factory->create($name, $config); |
|
33 | } |
||
34 | } |
||
35 | |||
36 | 1 | throw new \InvalidArgumentException(\sprintf( |
|
37 | 1 | 'The dictionary with named "%s" cannot be created.', |
|
38 | $name |
||
39 | )); |
||
53 |