Conditions | 4 |
Paths | 4 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 4.016 |
Changes | 0 |
1 | <?php |
||
31 | 9 | public function onKernelRequest(RequestEvent $event): void |
|
32 | { |
||
33 | 9 | $request = $event->getRequest(); |
|
34 | |||
35 | 9 | if (!$request->attributes->get(FOSRestBundle::ZONE_ATTRIBUTE, true)) { |
|
36 | 1 | return; |
|
37 | } |
||
38 | |||
39 | 8 | if (!$request->attributes->has('version')) { |
|
40 | return; |
||
41 | } |
||
42 | |||
43 | 8 | $version = $request->attributes->get('version'); |
|
44 | |||
45 | 8 | if ($this->viewHandler instanceof ConfigurableViewHandlerInterface) { |
|
46 | 8 | $this->viewHandler->setExclusionStrategyVersion($version); |
|
47 | } |
||
48 | 8 | } |
|
49 | } |
||
50 |