Conditions | 4 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
30 | public function setForm(GetResponseForControllerResultEvent $event): void |
||
31 | { |
||
32 | $form = $event->getControllerResult(); |
||
33 | $method = $event->getRequest()->getMethod(); |
||
34 | |||
35 | if (!$form instanceof Form || Request::METHOD_GET !== $method || $form->getForm()) { |
||
36 | return; |
||
37 | } |
||
38 | |||
39 | /** @var FormViewFactory $factory */ |
||
40 | $factory = $this->container->get(FormViewFactory::class); |
||
41 | $form->setForm($factory->create($form)); |
||
42 | } |
||
44 |