apiKeyService = $apiKeyService; } protected function configure(): void { $this->setName(self::NAME) ->setDescription('Disables an API key.') ->addArgument('apiKey', InputArgument::REQUIRED, 'The API key to disable'); } protected function execute(InputInterface $input, OutputInterface $output): ?int { $apiKey = $input->getArgument('apiKey'); $io = new SymfonyStyle($input, $output); try { $this->apiKeyService->disable($apiKey); $io->success(sprintf('API key "%s" properly disabled', $apiKey)); return ExitCodes::EXIT_SUCCESS; } catch (InvalidArgumentException $e) { $io->error(sprintf('API key "%s" does not exist.', $apiKey)); return ExitCodes::EXIT_FAILURE; } } }