| Conditions | 3 |
| Paths | 3 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 35 | public function resolve(ReportInterface $report): string |
||
| 36 | { |
||
| 37 | $reportConfiguration = $report->getReportConfiguration(); |
||
| 38 | if (null === $reportConfiguration) { |
||
| 39 | throw new RuntimeException(sprintf('No report configuration associated with report %s', $report->getId())); |
||
| 40 | } |
||
| 41 | |||
| 42 | $template = $this->twig->load($reportConfiguration->getTemplate()); |
||
| 43 | |||
| 44 | if (!$template->hasBlock('extension')) { |
||
| 45 | throw new InvalidArgumentException(sprintf( |
||
| 46 | 'The block "extension" is not present in the template %s', |
||
| 47 | $reportConfiguration->getTemplate() |
||
| 48 | )); |
||
| 49 | } |
||
| 50 | |||
| 51 | $extension = $template->renderBlock('extension'); |
||
| 52 | |||
| 53 | return 'stock-movement-report-' . $report->getId() . '.' . $extension; |
||
| 54 | } |
||
| 56 |