| Conditions | 6 |
| Paths | 7 |
| Total Lines | 21 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 43 | public function getContext(): ?array |
||
| 44 | { |
||
| 45 | if ($this->currentRequest === null) { |
||
| 46 | return null; |
||
| 47 | } |
||
| 48 | |||
| 49 | $controller = null; |
||
| 50 | |||
| 51 | if ($route = $this->currentRequest->route()) { |
||
| 52 | $controller = $route->controller; |
||
| 53 | |||
| 54 | if (! $controller && ! is_string($route->action['uses'])) { |
||
| 55 | $controller = $route->action['uses']; |
||
| 56 | } |
||
| 57 | } |
||
| 58 | |||
| 59 | return [ |
||
| 60 | 'uri' => $this->currentRequest->getUri(), |
||
| 61 | 'method' => $this->currentRequest->getMethod(), |
||
| 62 | 'controller' => $controller ? $this->cloner->cloneVar(class_basename($controller)) : $this->cloner->cloneVar(null), |
||
| 63 | 'identifier' => spl_object_hash($this->currentRequest), |
||
| 64 | ]; |
||
| 67 |