1 | <?php |
||
17 | class NavMatcher |
||
18 | { |
||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | private $active; |
||
23 | |||
24 | /** |
||
25 | * @var Route |
||
26 | */ |
||
27 | private $route; |
||
28 | |||
29 | /** |
||
30 | * NavMatcher constructor. |
||
31 | * @param Route $route |
||
32 | * @param string $active |
||
33 | */ |
||
34 | public function __construct(Route $route, string $active = 'active') |
||
39 | |||
40 | /** |
||
41 | * @param string $route |
||
42 | * @return string |
||
43 | */ |
||
44 | public function match(string $route): string |
||
50 | |||
51 | /** |
||
52 | * @param string $needle |
||
53 | * @return bool |
||
54 | */ |
||
55 | private function isCurrent(string $needle): bool |
||
59 | |||
60 | /** |
||
61 | * @param string $needle |
||
62 | * @return bool |
||
63 | */ |
||
64 | private function isMatched(string $needle): bool |
||
68 | } |