Conditions | 4 |
Paths | 8 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
19 | public function compile(iterable $inputs): ExampleStoreInterface |
||
20 | { |
||
21 | $globalStore = new CombinedExampleStore(); |
||
22 | |||
23 | foreach ($inputs as $input) { |
||
24 | try { |
||
25 | $template = $this->parser->parseContent($input->getContents()); |
||
26 | |||
27 | $template->setDefaultNamespace($input->getName()); |
||
28 | |||
29 | $globalStore->addExampleStore($template->render()); |
||
30 | } catch (InvalidPhpCodeException $exception) { |
||
31 | throw new InvalidInputException($exception->getMessage(), $input, $exception->getPhpCode()); |
||
32 | } catch (\Exception $exception) { |
||
33 | throw new InvalidInputException($exception->getMessage(), $input, $exception->getMessage()); |
||
34 | } |
||
35 | } |
||
36 | |||
37 | return $globalStore; |
||
38 | } |
||
40 |