Conditions | 6 |
Paths | 6 |
Total Lines | 24 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 14 |
CRAP Score | 6.1979 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | 12 | public function onCrudRequest(GetResponseEvent $event) |
|
26 | { |
||
27 | 12 | if (!$this->checkRequest($event)) { |
|
28 | return; |
||
29 | } |
||
30 | |||
31 | 12 | $route = $this->getRoute($event); |
|
32 | 12 | if (!$route->hasOption('cruds_options')) { |
|
33 | return; |
||
34 | } |
||
35 | |||
36 | 12 | $options = (array)$route->getOption('cruds_options'); |
|
37 | 12 | if (!array_key_exists('arguments', $options)) { |
|
38 | return; |
||
39 | } |
||
40 | |||
41 | 12 | $request = $event->getRequest(); |
|
42 | 12 | foreach ((array)$options['arguments'] as $param) { |
|
43 | 12 | $value = $request->get($param); |
|
44 | 12 | if (null !== $value) { |
|
45 | 12 | $request->attributes->set($param, $value); |
|
46 | 12 | } |
|
47 | 12 | } |
|
48 | 12 | } |
|
49 | |||
56 |