| Conditions | 3 |
| Paths | 2 |
| Total Lines | 23 |
| Code Lines | 14 |
| Lines | 10 |
| Ratio | 43.48 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function respond( |
||
| 25 | 2 | ActionConfiguration $configuration, |
|
| 26 | AdminInterface $admin, |
||
| 27 | 2 | FormInterface $form |
|
| 28 | ) { |
||
| 29 | 1 | $template = $configuration->getParameter('template'); |
|
| 30 | 1 | ||
| 31 | View Code Duplication | if ($form->isSubmitted() && $form->isValid()) { |
|
| 32 | $generator = new RouteNameGenerator(); |
||
| 33 | 1 | ||
| 34 | $url = $this |
||
| 35 | ->router |
||
| 36 | 1 | ->generate($generator->generate('list', $admin->getName(), $admin->getConfiguration())) |
|
| 37 | 1 | ; |
|
| 38 | 1 | ||
| 39 | return new RedirectResponse($url); |
||
| 40 | } |
||
| 41 | |||
| 42 | return $this->render($template, [ |
||
| 43 | 'admin' => $admin, |
||
| 44 | 'form' => $form->createView(), |
||
| 45 | ]); |
||
| 46 | } |
||
| 47 | } |
||
| 48 |