| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | public function handle(ViewInterface $view): Response |
||
| 23 | { |
||
| 24 | if ($view instanceof AdminView) { |
||
| 25 | return new Response($this->environment->render($view->getTemplate(), [ |
||
| 26 | 'admin' => $view, |
||
| 27 | ])); |
||
| 28 | } |
||
| 29 | |||
| 30 | if ($view instanceof RedirectView) { |
||
| 31 | return new RedirectResponse($this->router->generate($view->getRoute(), $view->getRouteParameters())); |
||
| 32 | } |
||
| 33 | |||
| 34 | throw new Exception(sprintf( |
||
| 35 | 'The view "%s" is not handle. Decorates the "%s" service to add your view logic', |
||
| 36 | get_class($view), |
||
| 37 | self::class, |
||
| 38 | )); |
||
| 41 |