| Total Complexity | 5 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 20 | final class RouteMatch implements RouteMatchInterface |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * @var RequestHandlerInterface |
||
| 24 | */ |
||
| 25 | private $handler; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @var array|null |
||
| 29 | */ |
||
| 30 | private $matches; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Router constructor. |
||
| 34 | * |
||
| 35 | * @param RequestHandlerInterface $notFoundHandler |
||
| 36 | */ |
||
| 37 | public function __construct(RequestHandlerInterface $handler, ?array $matches = null) |
||
| 38 | { |
||
| 39 | $this->handler = $handler; |
||
| 40 | $this->matches = $matches; |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @return bool |
||
| 45 | */ |
||
| 46 | public function isSuccess(): bool |
||
| 47 | { |
||
| 48 | return !empty($this->matches); |
||
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @return RequestHandlerInterface |
||
| 53 | */ |
||
| 54 | public function getHandler(): RequestHandlerInterface |
||
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @return array |
||
| 61 | */ |
||
| 62 | public function getVariables(): array |
||
| 65 | } |
||
| 66 | } |
||
| 67 |