Conditions | 3 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
30 | public function populateFileData(GetResponseForControllerResultEvent $event): void |
||
31 | { |
||
32 | $component = $event->getControllerResult(); |
||
33 | $method = $event->getRequest()->getMethod(); |
||
34 | |||
35 | if (!($component instanceof FileInterface || Request::METHOD_GET !== $method)) { |
||
36 | return; |
||
37 | } |
||
38 | |||
39 | /** @var FileDataFactory $factory */ |
||
40 | $factory = $this->container->get(FileDataFactory::class); |
||
41 | $fileData = $factory->create($component); |
||
42 | $component->setFileData($fileData); |
||
43 | } |
||
45 |