Conditions | 5 |
Paths | 5 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 5.1158 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | 26 | public function onCrudRequest(GetResponseEvent $event) |
|
12 | { |
||
13 | 26 | if (!$this->checkRequest($event)) { |
|
14 | return; |
||
15 | } |
||
16 | |||
17 | 26 | $options = $this->getNormalizedCrudApiOptions($event); |
|
18 | 26 | if (!$options['enabled']) { |
|
19 | return; |
||
20 | } |
||
21 | |||
22 | 26 | $request = $event->getRequest(); |
|
23 | 26 | foreach ((array)$options['arguments'] as $param) { |
|
24 | 26 | $value = $request->get($param); |
|
25 | 26 | if (null !== $value) { |
|
26 | 26 | $request->attributes->set($param, $value); |
|
27 | } |
||
28 | } |
||
29 | 26 | } |
|
30 | } |
||
31 |