| Conditions | 5 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public function isCurrent($item): bool |
||
| 32 | { |
||
| 33 | if (!$this->request || !$item instanceof MatchableInterface) { |
||
| 34 | return false; |
||
| 35 | } |
||
| 36 | |||
| 37 | // we search matches within URL and route |
||
| 38 | foreach ([$this->request->getPathInfo(), $this->request->get('_route', '')] as $url) { |
||
| 39 | if ($this->voter->matches($url, $item)) { |
||
| 40 | return true; |
||
| 41 | } |
||
| 42 | } |
||
| 43 | |||
| 44 | return false; |
||
| 45 | } |
||
| 47 |