Total Complexity | 5 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | class Router |
||
15 | { |
||
16 | /** @var string[] */ |
||
17 | protected static $routes = []; |
||
18 | |||
19 | /** |
||
20 | * Adiciona as rotas |
||
21 | * @param string $namespace |
||
22 | * @param string[] $routes |
||
23 | */ |
||
24 | public static function add($namespace, $routes) |
||
25 | { |
||
26 | foreach ($routes as $request => $destination) { |
||
27 | static::$routes[$request] = $namespace . $destination; |
||
28 | } |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * Percorre todas as rotas e retorna o destino final |
||
33 | * @return mixed Destino |
||
34 | * @example return [Controller, action, [..$args]] |
||
35 | */ |
||
36 | public static function getDestination() |
||
53 | } |
||
54 | } |
||
55 |