addArgument( 'repeat', InputArgument::OPTIONAL, 'The number of repeat', 1, new IntegerValidator(1, null) ); } /** * @inheritDoc */ protected function execute (InputInterface $input, OutputInterface $output): int { $output->writeln('Command : ' . __CLASS__, OutputInterface::VERBOSITY_DEBUG); $repeat = $input->getArgument('repeat'); var_dump($repeat); for ($curr = 0; $curr < $repeat; $curr++) { $output->writeln('Hello !'); } $output->writeln('FIN', ConsoleOutputWithMonolog::OPTION_SKIP_MONOLOG); return Command::SUCCESS; } }