addArgument('fullName', InputArgument::OPTIONAL, 'The full name of the user') ->addArgument('email', InputArgument::OPTIONAL, 'The email of the user'); } protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); $fullName = $input->getArgument('fullName'); $email = $input->getArgument('email'); if (!$fullName) { $fullName = $io->ask('Enter the full name of the user'); } if (!$email) { $email = $io->ask('Enter the email of the user'); } $token = Uuid::uuid4()->toString(); $user = new User(); $user->setFullName($fullName); $user->setEmail($email); $user->setToken($token); $this->userRepository->save($user); $io->success(sprintf('User "%s" with email "%s" has been added', $fullName, $email)); return Command::SUCCESS; } }