| Conditions | 3 |
| Paths | 6 |
| Total Lines | 12 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 41 | public function resolve($notCallable): callable |
||
| 42 | { |
||
| 43 | try { |
||
| 44 | $controllerName = $this->namespace . '\\' . $notCallable[0]; |
||
| 45 | $methodName = $notCallable[1]; |
||
| 46 | $result = [new $controllerName(), $methodName]; |
||
| 47 | if (is_callable($result)) { |
||
| 48 | return $result; |
||
| 49 | } |
||
| 50 | throw new \Exception("unable to resolve " . $notCallable[0]); |
||
| 51 | } catch (\Throwable $e) { |
||
| 52 | throw new \InvalidArgumentException($e->getMessage()); |
||
| 53 | } |
||
| 56 |