Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
33 | 8 | public function parse(Request $request) |
|
34 | { |
||
35 | 8 | $route = $request->route(); |
|
36 | |||
37 | 8 | if (! is_callable([$route, 'parameter'])) { |
|
38 | // Route may not be an instance of Illuminate\Routing\Route (it's an array |
||
39 | // in Lumen <5.2) or not exist at all (if the request was never dispatched) |
||
40 | 4 | return null; |
|
41 | } |
||
42 | 4 | return $route->parameter($this->key); |
|
43 | } |
||
44 | |||
59 |