Conditions | 3 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 3.072 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
25 | 2 | public function parse(Request $request) |
|
26 | { |
||
27 | // WARNING: Only use this parser if you know what you're doing! |
||
28 | // It will only work with poorly-specified aspects of certain Lumen releases. |
||
29 | 2 | $route = $request->route(); |
|
30 | |||
31 | 2 | if (! is_array($route) || ! array_has($route, '2.'.$this->key)) { |
|
32 | // Route is not the expected kind of array, or does not have a parameter |
||
33 | // with the key we want. |
||
34 | return null; |
||
35 | } |
||
36 | 2 | return $route[2][$this->key]; |
|
37 | } |
||
38 | } |
||
39 |