Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
29 | 4 | public function onKernelRequest(GetResponseEvent $event) |
|
30 | { |
||
31 | 4 | $request = $event->getRequest(); |
|
32 | 4 | $attributes = $request->attributes; |
|
33 | |||
34 | 4 | if (! $attributes->has('_dates')) { |
|
35 | 2 | return; |
|
36 | } |
||
37 | |||
38 | 2 | $dateKeys = $attributes->get('_dates', array(), true); |
|
39 | |||
40 | 2 | foreach ($dateKeys as $key) { |
|
41 | 2 | $rawValue = $request->get($key, null); |
|
42 | 2 | $parsedValue = $this->dateParser->parseDate($rawValue); |
|
43 | |||
44 | 2 | $request->attributes->set($key, $parsedValue); |
|
45 | 2 | } |
|
46 | 2 | } |
|
47 | |||
55 |