searchService = $searchService; } /** * @return void */ protected function configure() { $this->setName('radio:search'); $this->setDescription('Search for radio stations'); $this->addArgument("term", InputArgument::OPTIONAL); } protected function execute(InputInterface $input, OutputInterface $output): int { $radioStations = $this->searchService->findRadioStations( $input->getArgument("term") ); $output->writeln("Found radio stations"); foreach ($radioStations as $radioStation) { $output->writeln("* $radioStation"); } return 0; } }