/** * Execute the actual command. * * @param InputInterface $input * @param OutputInterface $output */ protected function execute(InputInterface $input, OutputInterface $output) { // timeout should be much lower in production, high due to latency / bandwidth via ADSL. $httpFetch = new HttpFetch(new Client(['timeout' => 5]), $output); $products = $httpFetch->fetchProducts($this->validateInputUrl($input, $output)); $output->write(json_encode($products)); }