1 | <?php |
||
11 | final class Router implements RouterInterface |
||
12 | { |
||
13 | /** |
||
14 | * @var Dispatcher |
||
15 | */ |
||
16 | private $dispatcher; |
||
17 | |||
18 | /** |
||
19 | * @var RouteInterface[] |
||
20 | */ |
||
21 | private $routes; |
||
22 | |||
23 | /** |
||
24 | * This method is not part of the public API. Implementations should use |
||
25 | * Router::fromArray(). |
||
26 | * |
||
27 | * @param RouteInterface[] A collection of routes |
||
28 | */ |
||
29 | 15 | public function __construct(array $routes) |
|
47 | |||
48 | /** |
||
49 | * @param RouteInterface[] A collection of routes |
||
50 | * @return self |
||
51 | */ |
||
52 | 15 | public static function fromArray(array $routes) |
|
56 | |||
57 | /** |
||
58 | * {@inheritdoc} |
||
59 | */ |
||
60 | 12 | public function match($method, $uri) |
|
73 | } |
||
74 |