Total Complexity | 5 |
Total Lines | 64 |
Duplicated Lines | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | abstract class RouteController |
||
24 | { |
||
25 | |||
26 | /** |
||
27 | * List of routes |
||
28 | * @var array |
||
29 | */ |
||
30 | protected static $routes = []; |
||
31 | |||
32 | /** |
||
33 | * Contains current route information |
||
34 | * @var array |
||
35 | */ |
||
36 | protected static $currentRoute = null; |
||
37 | |||
38 | /** |
||
39 | * @var bool |
||
40 | */ |
||
41 | public $csrfVerification = true; |
||
42 | |||
43 | /** |
||
44 | * Gets the current route |
||
45 | * @return array |
||
46 | */ |
||
47 | public static function getCurrentRoute(): ?array |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * @param array $route |
||
54 | */ |
||
55 | public static function setCurrentRoute(array $route) |
||
56 | { |
||
57 | self::$currentRoute = $route; |
||
58 | } |
||
59 | |||
60 | /** |
||
61 | * Set Routes |
||
62 | * @param array $routes |
||
63 | */ |
||
64 | public static function setRoutes(array $routes) |
||
65 | { |
||
66 | static::$routes = $routes; |
||
67 | } |
||
68 | |||
69 | /** |
||
70 | * Get Routes |
||
71 | * @return array |
||
72 | */ |
||
73 | public static function getRoutes(): array |
||
76 | } |
||
77 | |||
78 | /** |
||
79 | * Handles the missing methods of the controller |
||
80 | * @param string $method |
||
81 | * @param array $arguments |
||
82 | * @throws ControllerException |
||
83 | */ |
||
84 | public function __call(string $method, array $arguments) |
||
87 | } |
||
88 | } |
||
89 |