| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 46 | public function __invoke(string $name): Response |
||
| 47 | { |
||
| 48 | if (!$this->permissionApi->hasPermission('ZikulaCoreBundle::', 'static::' . $name, ACCESS_OVERVIEW)) { |
||
| 49 | throw new AccessDeniedException(); |
||
| 50 | } |
||
| 51 | |||
| 52 | if (!$this->twig->getLoader()->exists('p/' . $name . '.html.twig')) { |
||
| 53 | throw new NotFoundHttpException(sprintf('No route found for "%s"', 'GET /p/' . $name)); |
||
| 54 | } |
||
| 55 | |||
| 56 | return new Response($this->twig->render('p/' . $name . '.html.twig')); |
||
| 57 | } |
||
| 59 |