| 1 | <?php |
||
| 8 | class Route |
||
| 9 | { |
||
| 10 | use MiddlewaresTrait; |
||
| 11 | |||
| 12 | /** @var string */ |
||
| 13 | protected $path; |
||
| 14 | /** @var callable */ |
||
| 15 | protected $endPoint; |
||
| 16 | /** @var array */ |
||
| 17 | protected $methods = []; |
||
| 18 | /** @var array */ |
||
| 19 | protected $restrictions = []; |
||
| 20 | /** @var array */ |
||
| 21 | protected $matches = []; |
||
| 22 | |||
| 23 | 30 | public function __construct(string $path, callable $handler) |
|
| 28 | |||
| 29 | 11 | public function __invoke(RequestInterface $request) |
|
| 37 | |||
| 38 | 2 | public function getEndPoint() : EndPoint |
|
| 42 | |||
| 43 | 2 | public function setRestrictions(array $restrictions) |
|
| 48 | |||
| 49 | 8 | public function getRestrictions() : array |
|
| 53 | |||
| 54 | 8 | public function getPath() : string |
|
| 58 | |||
| 59 | 4 | public function setMatches(array $values = []) |
|
| 64 | |||
| 65 | 4 | public function getMatches() : array |
|
| 69 | |||
| 70 | 1 | public function getMethods() : array |
|
| 74 | |||
| 75 | 1 | public function setMethods(array $methods) |
|
| 80 | } |
||
| 81 |