1 | <?php |
||
17 | class Route implements ImmutableContainerAwareInterface, MiddlewareAwareInterface, StrategyAwareInterface |
||
18 | { |
||
19 | use ImmutableContainerAwareTrait; |
||
20 | use MiddlewareAwareTrait; |
||
21 | use RouteConditionTrait; |
||
22 | use StrategyAwareTrait; |
||
23 | |||
24 | /** |
||
25 | * @var string|callable |
||
26 | */ |
||
27 | protected $callable; |
||
28 | |||
29 | /** |
||
30 | * @var \League\Route\RouteGroup |
||
31 | */ |
||
32 | protected $group; |
||
33 | |||
34 | /** |
||
35 | * @var string[] |
||
36 | */ |
||
37 | protected $methods = []; |
||
38 | |||
39 | /** |
||
40 | * @var string |
||
41 | */ |
||
42 | protected $path; |
||
43 | |||
44 | /** |
||
45 | * Dispatch the route via the attached strategy. |
||
46 | * |
||
47 | * @param \Psr\Http\Message\ServerRequestInterface $request |
||
48 | * @param \Psr\Http\Message\ResponseInterface $response |
||
49 | * @param array $vars |
||
50 | * |
||
51 | * @throws \RuntimeException |
||
52 | * |
||
53 | * @return \Psr\Http\Message\ResponseInterface |
||
54 | */ |
||
55 | 24 | public function dispatch(ServerRequestInterface $request, ResponseInterface $response, array $vars) |
|
105 | |||
106 | /** |
||
107 | * Get the callable. |
||
108 | * |
||
109 | * @return string|callable |
||
110 | */ |
||
111 | 33 | public function getCallable() |
|
115 | |||
116 | /** |
||
117 | * Set the callable. |
||
118 | * |
||
119 | * @param string|callable $callable |
||
120 | * |
||
121 | * @return \League\Route\Route |
||
122 | */ |
||
123 | 42 | public function setCallable($callable) |
|
129 | |||
130 | /** |
||
131 | * Get the parent group. |
||
132 | * |
||
133 | * @return \League\Route\RouteGroup |
||
134 | */ |
||
135 | 6 | public function getParentGroup() |
|
139 | |||
140 | /** |
||
141 | * Set the parent group. |
||
142 | * |
||
143 | * @param \League\Route\RouteGroup $group |
||
144 | * |
||
145 | * @return \League\Route\Route |
||
146 | */ |
||
147 | 6 | public function setParentGroup(RouteGroup $group) |
|
153 | |||
154 | /** |
||
155 | * Get the path. |
||
156 | * |
||
157 | * @return string |
||
158 | */ |
||
159 | 21 | public function getPath() |
|
163 | |||
164 | /** |
||
165 | * Set the path. |
||
166 | * |
||
167 | * @param string $path |
||
168 | * |
||
169 | * @return \League\Route\Route |
||
170 | */ |
||
171 | 21 | public function setPath($path) |
|
177 | |||
178 | /** |
||
179 | * Get the methods. |
||
180 | * |
||
181 | * @return string[] |
||
182 | */ |
||
183 | 15 | public function getMethods() |
|
187 | |||
188 | /** |
||
189 | * Get the methods. |
||
190 | * |
||
191 | * @param string[] $methods |
||
192 | * |
||
193 | * @return \League\Route\Route |
||
194 | */ |
||
195 | 21 | public function setMethods(array $methods) |
|
201 | } |
||
202 |