1 | <?php |
||
15 | class SerializedRouteCollection extends RouteCollection |
||
16 | { |
||
17 | /** |
||
18 | * @var string[] |
||
19 | */ |
||
20 | private $serializedRoutes; |
||
21 | |||
22 | /** |
||
23 | * @var Route[] |
||
24 | */ |
||
25 | private $cache = []; |
||
26 | |||
27 | /** |
||
28 | * @param string[] $routes |
||
29 | */ |
||
30 | 6 | public function __construct(array $routes = []) |
|
34 | |||
35 | /** |
||
36 | * @param string $name |
||
37 | * @return Route |
||
38 | */ |
||
39 | 3 | public function get($name) |
|
51 | |||
52 | 2 | public function all() |
|
58 | |||
59 | 2 | /** |
|
60 | * Gets the current RouteCollection as an Iterator that includes all routes. |
||
61 | 2 | * |
|
62 | * It implements \IteratorAggregate. |
||
63 | * |
||
64 | * @see all() |
||
65 | * |
||
66 | * @return ArrayIterator An \ArrayIterator object for iterating over routes |
||
67 | */ |
||
68 | public function getIterator() |
||
74 | |||
75 | 2 | /** |
|
76 | * Gets the number of Routes in this collection. |
||
77 | 2 | * |
|
78 | * @return int The number of routes |
||
79 | */ |
||
80 | public function count() |
||
84 | |||
85 | 1 | /** |
|
86 | * @param string $name |
||
87 | 1 | * @param Route $route |
|
88 | */ |
||
89 | public function add($name, Route $route) |
||
93 | 1 | ||
94 | /** |
||
95 | * @param array|string $name |
||
96 | 1 | */ |
|
97 | public function remove($name) |
||
102 | |||
103 | private function initAll() |
||
107 | } |
||
108 |