1 | <?php |
||
9 | class Route |
||
10 | { |
||
11 | use MiddlewaresTrait; |
||
12 | |||
13 | /** @var string */ |
||
14 | protected $path; |
||
15 | /** @var callable */ |
||
16 | protected $endPoint; |
||
17 | /** @var array */ |
||
18 | protected $methods = []; |
||
19 | /** @var array */ |
||
20 | protected $restrictions = []; |
||
21 | /** @var array */ |
||
22 | protected $matches = []; |
||
23 | |||
24 | 31 | public function __construct(string $path, callable $handler) |
|
29 | |||
30 | 12 | public function __invoke(RequestInterface $request) |
|
38 | |||
39 | 2 | public function getEndPoint(): EndPoint |
|
43 | |||
44 | 2 | public function setRestrictions(array $restrictions): self |
|
49 | |||
50 | 8 | public function getRestrictions(): array |
|
54 | |||
55 | 8 | public function getPath(): string |
|
59 | |||
60 | 4 | public function setMatches(array $values = []): self |
|
65 | |||
66 | 4 | public function getMatches(): array |
|
70 | |||
71 | 1 | public function getMethods(): array |
|
75 | |||
76 | 1 | public function setMethods(array $methods): self |
|
81 | } |
||
82 |