| Conditions | 4 |
| Paths | 4 |
| Total Lines | 22 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | protected function checkRequest(KernelEvent $event) |
||
| 19 | { |
||
| 20 | $request = $event->getRequest(); |
||
| 21 | $route = $request->attributes->get('_route'); |
||
| 22 | |||
| 23 | if (null === $route) { |
||
| 24 | return false; |
||
| 25 | } |
||
| 26 | |||
| 27 | $collection = $this->getRouter()->getRouteCollection(); |
||
| 28 | $route = $collection->get($route); |
||
| 29 | |||
| 30 | if (null === $route) { |
||
| 31 | return false; |
||
| 32 | } |
||
| 33 | |||
| 34 | if (!$route->getOption('cruds_api')) { |
||
| 35 | return false; |
||
| 36 | } |
||
| 37 | |||
| 38 | return true; |
||
| 39 | } |
||
| 40 | } |
||
| 41 |