| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 51 | public function execute(string $namespace, mixed $param): void |
||
| 52 | { |
||
| 53 | $controller = $namespace . "\\" . $this->controller; |
||
| 54 | |||
| 55 | if (!class_exists($controller)) { |
||
| 56 | throw new ErrorRoute("Class {$controller} not found", 501); |
||
| 57 | } |
||
| 58 | |||
| 59 | if (!method_exists($controller, $this->method)) { |
||
| 60 | throw new ErrorRoute("Method {$this->method} not found", 405); |
||
| 61 | } |
||
| 62 | |||
| 63 | call_user_func([new $controller(), $this->method], $param); |
||
| 64 | } |
||
| 66 |