Total Complexity | 2 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
19 | class Route_Collection extends Collection { |
||
20 | |||
21 | protected const ALLOWED_ROUTE_TYPES = array( Route::class, Route_Group::class ); |
||
22 | |||
23 | /** |
||
24 | * Overwrite this method in any extended classes, to modify the inital data. |
||
25 | * |
||
26 | * @param array<int|string, mixed> $data |
||
27 | * @return array<int|string, mixed> |
||
28 | */ |
||
29 | protected function map_construct( array $data ): array { |
||
37 | ); |
||
38 | } |
||
39 | ); |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * Adds a route to the collection |
||
44 | * |
||
45 | * @param Route|Route_Group $route |
||
46 | * @return static |
||
47 | */ |
||
48 | public function add_route( $route ) { |
||
53 |