addArgument('domain', InputArgument::REQUIRED, 'The domain name to register') ->addOption('force', 'f', InputOption::VALUE_NEGATABLE, 'Do not check the freshness of the data and still make the query', false); } protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); $ldhName = strtolower(idn_to_ascii($input->getArgument('domain'))); $force = (bool) $input->getOption('force'); $domain = $this->domainRepository->findOneBy(['ldhName' => $ldhName]); try { if (null !== $domain && !$force) { if (!$domain->isToBeUpdated()) { $io->warning('The domain name is already present in the database and does not need to be updated at this time.'); return Command::SUCCESS; } } $this->rdapService->registerDomain($ldhName); } catch (\Throwable $e) { $io->error($e->getMessage()); return Command::FAILURE; } $io->success('The domain name has been successfully registered in the database.'); return Command::SUCCESS; } }