console = $console; return $this; } /** * @return ConsoleAdapter */ public function getConsole() { return $this->console; } /** * {@inheritdoc} */ public function dispatch(RequestInterface $request, ResponseInterface $response = null) { if (! $request instanceof ConsoleRequest) { throw new InvalidArgumentException(sprintf( '%s can only dispatch requests in a console environment', get_called_class() )); } return parent::dispatch($request, $response); } /** * Action called if matched action does not exist. * * @return ViewModel */ public function notFoundAction() { $event = $this->getEvent(); $routeMatch = $event->getRouteMatch(); $routeMatch->setParam('action', 'not-found'); $helper = $this->plugin('createConsoleNotFoundModel'); return $helper(); } }