Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
64 | public function execute(string $namespace): void |
||
65 | { |
||
66 | $controller = $namespace . "\\" . $this->controller; |
||
67 | |||
68 | if (!class_exists($controller)) { |
||
69 | throw new ErrorRoute("Class {$controller} not found", 501); |
||
70 | } |
||
71 | |||
72 | if (!method_exists($controller, $this->method)) { |
||
73 | throw new ErrorRoute("Method {$this->method} not found", 405); |
||
74 | } |
||
75 | |||
76 | call_user_func([new $controller(), $this->method], $this->param); |
||
77 | } |
||
79 |