Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | public function createCompilerFactory(string $id): CompilerFactoryInterface |
||
19 | { |
||
20 | try { |
||
21 | $factory = $this->instantiator->getNewObject( |
||
22 | Configs::expand(Configs::INPUT_ID, $id), |
||
23 | ); |
||
24 | } catch (InstantiatorException $exception) { |
||
25 | throw new InvalidInputLanguageException("Invalid input language $id: {$exception->getMessage()}"); |
||
26 | } |
||
27 | |||
28 | if (!$factory instanceof CompilerFactoryInterface) { |
||
29 | throw new InvalidInputLanguageException( |
||
30 | "Invalid input language $id: Class does not implement CompilerFactoryInterface" |
||
31 | ); |
||
32 | } |
||
33 | |||
34 | return $factory; |
||
35 | } |
||
37 |