| Conditions | 4 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 35 | public function matchItem(ItemInterface $item) |
||
| 36 | { |
||
| 37 | $request = $this->requestStack->getCurrentRequest(); |
||
| 38 | |||
| 39 | if ($item->getUri() === $request->getRequestUri()) { |
||
| 40 | // URL's completely match |
||
| 41 | return true; |
||
| 42 | } elseif ($item->getUri() !== $request->getBaseUrl() . '/' && |
||
| 43 | substr($request->getRequestUri(), 0, strlen($item->getUri())) |
||
| 44 | === $item->getUri()) { |
||
| 45 | // URL isn't just "/" and the first part of the URL match |
||
| 46 | return true; |
||
| 47 | } |
||
| 48 | |||
| 49 | return null; |
||
| 50 | } |
||
| 51 | } |
||
| 52 |