1 | <?php |
||
22 | class Router |
||
23 | { |
||
24 | /** |
||
25 | * @var array |
||
26 | */ |
||
27 | protected $options; |
||
28 | |||
29 | /** |
||
30 | * @var array |
||
31 | */ |
||
32 | protected $routes; |
||
33 | |||
34 | /** |
||
35 | * @var RouteableInterface |
||
36 | */ |
||
37 | protected $handler; |
||
38 | |||
39 | /** |
||
40 | * @var RouteCollector |
||
41 | */ |
||
42 | protected $routeCollector; |
||
43 | |||
44 | /** |
||
45 | * @var Dispatcher |
||
46 | */ |
||
47 | protected $dispatcher; |
||
48 | |||
49 | 8 | public function __construct(RouteableInterface $handler, array $options = []) |
|
62 | |||
63 | 6 | public function buildRoutes() |
|
88 | |||
89 | /** |
||
90 | * @param ServerRequestInterface $request |
||
91 | * |
||
92 | * @return ResponseInterface |
||
93 | * @throws RouteMethodNotAllowedException |
||
94 | * @throws RouteNotFoundException |
||
95 | */ |
||
96 | 4 | public function handleRequest(ServerRequestInterface $request) : ResponseInterface |
|
118 | |||
119 | /** |
||
120 | * @return Dispatcher |
||
121 | */ |
||
122 | 5 | public function getDispatcher() : Dispatcher |
|
134 | |||
135 | /** |
||
136 | * @param Dispatcher $dispatcher |
||
137 | * |
||
138 | * @return $this |
||
139 | */ |
||
140 | 4 | public function setDispatcher(Dispatcher $dispatcher) : self |
|
146 | |||
147 | /** |
||
148 | * @return RouteCollector |
||
149 | */ |
||
150 | 6 | public function getRouteCollector() : RouteCollector |
|
162 | |||
163 | /** |
||
164 | * @param RouteCollector $routeCollector |
||
165 | * |
||
166 | * @return $this |
||
167 | */ |
||
168 | 1 | public function setRouteCollector(RouteCollector $routeCollector) : self |
|
174 | |||
175 | /** |
||
176 | * @return array |
||
177 | */ |
||
178 | 1 | public function getRouteData() : array |
|
184 | } |
||
185 |