1 | <?php |
||
11 | class SlimRouter implements RouterInterface |
||
12 | { |
||
13 | /** |
||
14 | * @var Router |
||
15 | */ |
||
16 | private $router; |
||
17 | /** |
||
18 | * @var Route[] |
||
19 | */ |
||
20 | private $routes; |
||
21 | |||
22 | 9 | public function __construct(Router $router = null) |
|
31 | |||
32 | /** |
||
33 | * Create a default Aura router instance |
||
34 | * |
||
35 | * @return Router |
||
36 | */ |
||
37 | 9 | private function createRouter() |
|
41 | |||
42 | /** |
||
43 | * @param Route $route |
||
44 | */ |
||
45 | 6 | public function addRoute(Route $route): void |
|
49 | |||
50 | 1 | public function dummyCallable() |
|
53 | |||
54 | /** |
||
55 | * @param Request $request |
||
56 | * @return RouteResult |
||
57 | */ |
||
58 | 2 | public function match(Request $request): RouteResult |
|
83 | |||
84 | /** |
||
85 | * Generate a URI from the named route. |
||
86 | * |
||
87 | * Takes the named route and any substitutions, and attempts to generate a |
||
88 | * URI from it. Additional router-dependent options may be passed. |
||
89 | * |
||
90 | * The URI generated MUST NOT be escaped. If you wish to escape any part of |
||
91 | * the URI, this should be performed afterwards; consider passing the URI |
||
92 | * to league/uri to encode it. |
||
93 | * |
||
94 | * @see https://github.com/auraphp/Aura.Router#generating-a-route-path |
||
95 | * @see http://framework.zend.com/manual/current/en/modules/zend.mvc.routing.html |
||
96 | * @param string $name |
||
97 | * @param array $substitutions |
||
98 | * @param array $options |
||
99 | * @return string |
||
100 | * @throws Exception\RuntimeException if unable to generate the given URI. |
||
101 | */ |
||
102 | 2 | public function generateUri(string $name, array $substitutions = [], array $options = []): string |
|
115 | |||
116 | 7 | private function injectRoutes(): void |
|
123 | |||
124 | 6 | private function injectRoute(Route $route): void |
|
148 | } |
||
149 |