/** * Get the controller context * * @param ControllerContextInterface $context Context to cast to a local context * @return DispatcherContext */ public function getContext(ControllerContextInterface $context = null) { $context = new DispatcherContext($context); $context->setRequest($this->getRequest()); $context->setUser($this->getUser()); $context->setResponse($this->getResponse()); return $context; }