/** * Mediates Request handling between HttpKernelInterface and the Mainframe. * {@inheritdoc} */ public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true) { $command = $this->converter->convert($request); $packet = $this->mainframe->execute($command); $content = $packet['output']; if ($command instanceof SlashCommand && $content instanceof Reply) { $content = $content->get('text'); } return new Response($content); }