1 | <?php |
||
8 | class Route |
||
9 | { |
||
10 | /** |
||
11 | * @var |
||
12 | */ |
||
13 | protected $uri; |
||
14 | |||
15 | /** |
||
16 | * @var |
||
17 | */ |
||
18 | protected $name; |
||
19 | |||
20 | /** |
||
21 | * @var |
||
22 | */ |
||
23 | protected $action; |
||
24 | |||
25 | /** |
||
26 | * @var |
||
27 | */ |
||
28 | protected $params; |
||
29 | |||
30 | /** |
||
31 | * @param $uri |
||
32 | * @param $name |
||
33 | * @param $action |
||
34 | */ |
||
35 | 14 | public function __construct($uri, $name, $action) |
|
41 | |||
42 | /** |
||
43 | * @return mixed |
||
44 | */ |
||
45 | 11 | public function getUri() |
|
49 | |||
50 | |||
51 | /** |
||
52 | * @throws InvalidArgumentException |
||
53 | * @return mixed Closure|Controller |
||
54 | */ |
||
55 | 7 | public function getAction() |
|
70 | |||
71 | /** |
||
72 | * Check if route matches given url |
||
73 | * |
||
74 | * @param ServerRequestInterface $request |
||
75 | * @return bool |
||
76 | */ |
||
77 | 10 | public function matches(ServerRequestInterface $request) |
|
81 | |||
82 | 2 | public function getQueryParams() { |
|
85 | |||
86 | 2 | public function setParams(array $params = []) |
|
92 | } |
||
93 |