1 | <?php declare(strict_types=1); |
||
12 | class Route implements |
||
13 | MiddlewareInterface, |
||
14 | MiddlewareAwareInterface, |
||
15 | RouteConditionHandlerInterface, |
||
16 | StrategyAwareInterface |
||
17 | { |
||
18 | use MiddlewareAwareTrait; |
||
19 | use RouteConditionHandlerTrait; |
||
20 | use StrategyAwareTrait; |
||
21 | |||
22 | /** |
||
23 | * @var callable|string |
||
24 | */ |
||
25 | protected $handler; |
||
26 | |||
27 | /** |
||
28 | * @var \League\Route\RouteGroup |
||
29 | */ |
||
30 | protected $group; |
||
31 | |||
32 | /** |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $method; |
||
36 | |||
37 | /** |
||
38 | * @var string |
||
39 | */ |
||
40 | protected $path; |
||
41 | |||
42 | /** |
||
43 | * @var array |
||
44 | */ |
||
45 | protected $vars = []; |
||
46 | |||
47 | 45 | public function __construct(string $method, string $path, $handler) |
|
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | 12 | public function process( |
|
63 | |||
64 | /** |
||
65 | * Get the callable. |
||
66 | * |
||
67 | * @param ?\Psr\Container\ContainerInterface $container |
||
|
|||
68 | * |
||
69 | * @throws \RuntimeException |
||
70 | * |
||
71 | * @return callable |
||
72 | */ |
||
73 | 33 | public function getCallable(?ContainerInterface $container = null) : callable |
|
99 | |||
100 | /** |
||
101 | * Return vars to be passed to route callable. |
||
102 | * |
||
103 | * @return array |
||
104 | */ |
||
105 | 15 | public function getVars() : array |
|
109 | |||
110 | /** |
||
111 | * Set vars to be passed to route callable. |
||
112 | * |
||
113 | * @param array $vars |
||
114 | * |
||
115 | * @return \League\Route\Route |
||
116 | */ |
||
117 | 15 | public function setVars(array $vars) : self |
|
123 | |||
124 | /** |
||
125 | * Get the parent group. |
||
126 | * |
||
127 | * @return ?\League\Route\RouteGroup |
||
128 | */ |
||
129 | 15 | public function getParentGroup() : ?RouteGroup |
|
133 | |||
134 | /** |
||
135 | * Set the parent group. |
||
136 | * |
||
137 | * @param \League\Route\RouteGroup $group |
||
138 | * |
||
139 | * @return \League\Route\Route |
||
140 | */ |
||
141 | 3 | public function setParentGroup(RouteGroup $group) : self |
|
147 | |||
148 | /** |
||
149 | * Get the path. |
||
150 | * |
||
151 | * @return string |
||
152 | */ |
||
153 | 24 | public function getPath() : string |
|
157 | |||
158 | /** |
||
159 | * Get the methods. |
||
160 | * |
||
161 | * @return string |
||
162 | */ |
||
163 | 24 | public function getMethod() : string |
|
167 | } |
||
168 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.