| 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 provideDefaultLayout(GetResponseForControllerResultEvent $event): void |
||
| 31 | { |
||
| 32 | $page = $event->getControllerResult(); |
||
| 33 | $method = $event->getRequest()->getMethod(); |
||
| 34 | |||
| 35 | if (!$page instanceof Page || Request::METHOD_GET !== $method || $page->getLayout()) { |
||
| 36 | return; |
||
| 37 | } |
||
| 38 | |||
| 39 | /** @var LayoutRepository $repository */ |
||
| 40 | $repository = $this->container->get(LayoutRepository::class); |
||
| 41 | $page->setLayout($repository->findOneBy(['default' => true])); |
||
| 42 | } |
||
| 44 |