1 | <?php declare(strict_types=1); |
||
41 | class Route implements RouteInterface |
||
42 | { |
||
43 | use CallableTrait, UriTrait, HasConfiguratorsTrait, HasMiddlewareTrait, HasRequestFactoryTrait, CheckCallableTrait { |
||
44 | CheckCallableTrait::checkPublicStaticCallable insteadof HasMiddlewareTrait; |
||
45 | CheckCallableTrait::checkPublicStaticCallable insteadof HasConfiguratorsTrait; |
||
46 | CheckCallableTrait::checkPublicStaticCallable insteadof HasRequestFactoryTrait; |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * @var GroupInterface |
||
51 | */ |
||
52 | private $group; |
||
53 | |||
54 | /** |
||
55 | * @var string |
||
56 | */ |
||
57 | private $method; |
||
58 | |||
59 | /** |
||
60 | * @var string |
||
61 | */ |
||
62 | private $uriPath; |
||
63 | |||
64 | /** |
||
65 | * @var callable |
||
66 | */ |
||
67 | private $handler; |
||
68 | |||
69 | /** |
||
70 | * @var bool |
||
71 | */ |
||
72 | private $isGroupRequestFactory = true; |
||
73 | |||
74 | /** |
||
75 | * @var string|null |
||
76 | */ |
||
77 | private $name; |
||
78 | |||
79 | /** |
||
80 | * @param GroupInterface $group |
||
81 | * @param string $method |
||
82 | * @param string $uriPath |
||
83 | * @param callable $handler |
||
84 | * |
||
85 | 22 | * @throws ReflectionException |
|
86 | */ |
||
87 | 22 | public function __construct(GroupInterface $group, string $method, string $uriPath, callable $handler) |
|
95 | |||
96 | /** |
||
97 | * @param string|null $name |
||
98 | * |
||
99 | 18 | * @return self |
|
100 | */ |
||
101 | 18 | public function setName(string $name = null): self |
|
107 | |||
108 | /** |
||
109 | 18 | * @inheritdoc |
|
110 | */ |
||
111 | 18 | public function getGroup(): GroupInterface |
|
115 | |||
116 | /** |
||
117 | 17 | * @inheritdoc |
|
118 | */ |
||
119 | 17 | public function getMethod(): string |
|
123 | |||
124 | /** |
||
125 | 18 | * @inheritdoc |
|
126 | */ |
||
127 | 18 | public function getUriPath(): string |
|
133 | |||
134 | /** |
||
135 | 17 | * @inheritdoc |
|
136 | */ |
||
137 | 17 | public function getMiddleware(): array |
|
141 | |||
142 | /** |
||
143 | 17 | * @inheritdoc |
|
144 | */ |
||
145 | 17 | public function getHandler(): callable |
|
149 | |||
150 | /** |
||
151 | 17 | * @inheritdoc |
|
152 | */ |
||
153 | 17 | public function getContainerConfigurators(): array |
|
157 | |||
158 | /** |
||
159 | 17 | * @inheritdoc |
|
160 | */ |
||
161 | 17 | public function getRequestFactory(): ?callable |
|
169 | |||
170 | /** |
||
171 | 17 | * @return bool |
|
172 | */ |
||
173 | 17 | public function isUseGroupRequestFactory(): bool |
|
177 | |||
178 | /** |
||
179 | * @param bool $isGroupFactory |
||
180 | * |
||
181 | 21 | * @return self |
|
182 | */ |
||
183 | 21 | public function setUseGroupRequestFactory(bool $isGroupFactory): self |
|
189 | |||
190 | /** |
||
191 | 16 | * @inheritdoc |
|
192 | */ |
||
193 | 16 | public function getName(): ?string |
|
199 | |||
200 | /** |
||
201 | * @param callable $handler |
||
202 | * |
||
203 | * @return self |
||
204 | * |
||
205 | 22 | * @throws ReflectionException |
|
206 | */ |
||
207 | 22 | protected function setHandler(callable $handler): self |
|
224 | } |
||
225 |