| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 4.432 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | 1 | public function handle(Request $request) |
|
| 23 | { |
||
| 24 | 1 | $routeParameters = $request->get('_route_params'); |
|
| 25 | |||
| 26 | 1 | if (!$routeParameters) { |
|
| 27 | throw new Exception('Cannot find admin from request. _route_params parameters for request not found'); |
||
| 28 | } |
||
| 29 | 1 | if (!array_key_exists('_admin', $routeParameters)) { |
|
| 30 | throw new Exception('Cannot find admin from request. "_admin" route parameter is missing'); |
||
| 31 | } |
||
| 32 | 1 | if (!array_key_exists('_action', $routeParameters)) { |
|
| 33 | throw new Exception('Cannot find admin action from request. "_action" route parameter is missing'); |
||
| 34 | } |
||
| 35 | |||
| 36 | 1 | return $this |
|
| 37 | ->registry |
||
| 38 | 1 | ->get($routeParameters['_admin']); |
|
| 39 | } |
||
| 40 | } |
||
| 41 |