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