#[AsCommand(name: 'app:import-users', description: 'Import users from CSV')]
class ImportUsersCommand extends Command {
protected function execute(InputInterface $input, OutputInterface $output): int {
$io = new SymfonyStyle($input, $output);
$io->title('Importing users...');
$io->progressStart(100);
// ...
$io->progressFinish();
$io->success('Imported 100 users');
return Command::SUCCESS;
}
}Symfony Console используется в Laravel (Artisan), Doctrine, PHPUnit и многих других проектах.