<?phpnamespace App\Command;use App\Chat\TempId;use Symfony\Component\Console\Attribute\AsCommand;use Symfony\Component\Console\Command\Command;use Symfony\Component\Console\Input\InputArgument;use Symfony\Component\Console\Input\InputInterface;use Symfony\Component\Console\Input\InputOption;use Symfony\Component\Console\Output\OutputInterface;/** Prints the tempid a client sends for a profile (what a web site or a test tool gives the client). */#[AsCommand('token', 'Prints the tempid of a profile (nickname, age, sex, city, admin key)')]final class TokenCommand extends Command{ protected function configure(): void { $this ->addArgument('nickname', InputArgument::REQUIRED) ->addOption('age', 'a', InputOption::VALUE_REQUIRED, 'age', '25') ->addOption('sex', 's', InputOption::VALUE_REQUIRED, '0 = woman, 1 = man, 2 = other', '1') ->addOption('city', 'c', InputOption::VALUE_REQUIRED, 'city', '') ->addOption('admin-key', 'k', InputOption::VALUE_REQUIRED, 'moderator key', ''); } protected function execute(InputInterface $input, OutputInterface $output): int { $output->writeln(TempId::make((string)$input->getArgument('nickname'), (int)$input->getOption('age'), (int)$input->getOption('sex'), (string)$input->getOption('city'), (string)$input->getOption('admin-key'))); return Command::SUCCESS; }}