addArgument('url', InputArgument::REQUIRED, 'The URL to fetch'); } protected function execute(InputInterface $input, OutputInterface $output): int { $input->setOption('ansi', true); /** @psalm-suppress MixedAssignment */ $url = $input->getArgument('url'); $config = Configuration::fromInput($input); $config->addCasters([ Crawler::class => 'RoachPHP\Shell\ShellCaster::castCrawler', Link::class => 'RoachPHP\Shell\ShellCaster::castLink', Response::class => 'RoachPHP\Shell\ShellCaster::castResponse', ]); $config->addCommands([new FetchCommand()]); $shell = new Shell($config); $command = $shell->find('fetch'); $command->run(new ArrayInput(['url' => $url]), $output); $shell->run(); return 0; } }