Total Complexity | 5 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Coverage | 76.92% |
Changes | 4 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
9 | final class Gii implements GiiInterface |
||
10 | { |
||
11 | /** |
||
12 | * @param array<string, GeneratorInterface> $generators |
||
13 | */ |
||
14 | 4 | public function __construct(private array $generators) |
|
19 | 4 | ); |
|
20 | } |
||
21 | |||
22 | public function addGenerator(GeneratorInterface $generator): void |
||
25 | } |
||
26 | |||
27 | 1 | public function getGenerator(string $id): GeneratorInterface |
|
28 | { |
||
29 | 1 | if (!isset($this->generators[$id])) { |
|
30 | 1 | throw new GeneratorNotFoundException('Generator "' . $id . '" not found'); |
|
31 | } |
||
32 | |||
33 | return $this->generators[$id]; |
||
34 | } |
||
35 | |||
36 | 2 | public function getGenerators(): array |
|
39 | } |
||
40 | } |
||
41 |