protected function execute(InputInterface $input, OutputInterface $output)
{
$this->validateInput($input);
$environment = $this->getSelectedEnvironment();
$routes = $environment->getRoutes();
if (empty($routes)) {
$this->stdErr->writeln("No routes found");
return 0;
}
$table = new Table($input, $output);
$header = ['Route', 'Type', 'To', 'Cache', 'SSI'];
$rows = [];
foreach ($routes as $route) {
$rows[] = [$route->id, $route->type, $route->type == 'upstream' ? $route->upstream : $route->to, json_encode($route->cache), json_encode($route->ssi)];
}
if (!$table->formatIsMachineReadable()) {
$this->stdErr->writeln("Routes for the environment <info>{$environment->id}</info>:");
}
$table->render($rows, $header);
return 0;
}