| Total Complexity | 8 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class ParametersExtractor implements ParametersExtractorInterface |
||
| 12 | { |
||
| 13 | 2 | public function getResourceName(Request $request): string |
|
| 14 | { |
||
| 15 | 2 | if (!$this->supports($request)) { |
|
| 16 | 1 | throw new Exception('No admin resource was found in the request. The route is wrongly configured'); |
|
| 17 | } |
||
| 18 | |||
| 19 | 1 | return $request->get('_route_params')[LAGAdminBundle::REQUEST_PARAMETER_ADMIN]; |
|
| 20 | } |
||
| 21 | |||
| 22 | 2 | public function getOperationName(Request $request): string |
|
| 23 | { |
||
| 24 | 2 | if (!$this->supports($request)) { |
|
| 25 | 1 | throw new Exception('No action resource was found in the request. The route is wrongly configured'); |
|
| 26 | } |
||
| 27 | |||
| 28 | 1 | return $request->get('_route_params')[LAGAdminBundle::REQUEST_PARAMETER_ACTION]; |
|
| 29 | } |
||
| 30 | |||
| 31 | 9 | public function supports(Request $request): bool |
|
| 47 | } |
||
| 48 | } |
||
| 49 |