| Conditions | 4 |
| Paths | 3 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 43 | protected function voteOnAttribute($route, $notRequired, TokenInterface $token): bool |
||
| 44 | { |
||
| 45 | foreach ($this->config as $index => $routeConfig) { |
||
| 46 | $routeRegex = str_replace('\*', '(.*)', preg_quote($routeConfig['route'], '#')); |
||
| 47 | if (!$this->resourceAccessChecker->isGranted(\get_class($route), $routeConfig['security']) && preg_match(sprintf('#%s#', $routeRegex), $route->getPath())) { |
||
| 48 | return false; |
||
| 49 | } |
||
| 50 | } |
||
| 51 | |||
| 52 | return true; |
||
| 53 | } |
||
| 55 |