Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
56 | public function __invoke($name) |
||
57 | { |
||
58 | if(!isset($this->routes[$name])){ |
||
59 | throw new \Exception('Route not found'); |
||
60 | } |
||
61 | |||
62 | $route = $this->routes[$name]; |
||
63 | |||
64 | $controllerName = $route->getController(); |
||
65 | $controller = new $controllerName($this->db); |
||
66 | |||
67 | call_user_func([$controller, $route->getMethod()]); |
||
68 | } |
||
69 | |||
72 | } |