1 | <?php |
||
13 | class UriMatcher implements MatcherInterface |
||
14 | { |
||
15 | |||
16 | /** |
||
17 | * @var |
||
18 | */ |
||
19 | private $router; |
||
20 | |||
21 | /** |
||
22 | * @var array |
||
23 | */ |
||
24 | private $request = []; |
||
25 | |||
26 | /** |
||
27 | * @var array |
||
28 | */ |
||
29 | private $resolver = ['isControllerAndTemplate']; |
||
30 | |||
31 | /** |
||
32 | * @var array |
||
33 | */ |
||
34 | private $dispatcher = [ |
||
35 | 'isTemplate' => TemplateDispatcher::class, |
||
36 | 'isController' => ControllerDispatcher::class, |
||
37 | 'isControllerAndTemplate' => [ControllerDispatcher::class, TemplateDispatcher::class], |
||
38 | ]; |
||
39 | |||
40 | /** |
||
41 | * @param Router $router |
||
42 | */ |
||
43 | public function __construct(Router $router) |
||
47 | |||
48 | /** |
||
49 | * @param array $resolver |
||
50 | */ |
||
51 | public function setResolver($resolver = []) |
||
55 | |||
56 | /** |
||
57 | * @param string $resolver |
||
58 | */ |
||
59 | public function addResolver($resolver) |
||
63 | |||
64 | /** |
||
65 | * @return array |
||
66 | */ |
||
67 | public function getResolver() |
||
71 | |||
72 | /** |
||
73 | * @param array $dispatcher |
||
74 | */ |
||
75 | public function setDispatcher($dispatcher = []) |
||
79 | |||
80 | /** |
||
81 | * @param $method |
||
82 | * @param $class |
||
83 | */ |
||
84 | public function addDispatcher($method, $class) |
||
88 | |||
89 | /** |
||
90 | * @return bool |
||
91 | */ |
||
92 | public function match() |
||
102 | |||
103 | /** |
||
104 | * @param array $target |
||
105 | */ |
||
106 | public function setTarget($target = []) |
||
115 | |||
116 | /** |
||
117 | * @return array|bool |
||
118 | */ |
||
119 | public function isControllerAndTemplate() |
||
131 | |||
132 | /** |
||
133 | * @return bool|array |
||
134 | */ |
||
135 | public function isTemplate() |
||
158 | |||
159 | /** |
||
160 | * @return bool|array |
||
161 | */ |
||
162 | public function isController() |
||
188 | |||
189 | } |
||
190 |