class MyCommand extends \Symfony\Component\Console\Command\Command
{
use Invokable;
// $username/$roles are the argument/option defined below
public function __invoke(IO $io, string $username, array $roles)
{
$io->success('created.');
// even if you don't inject IO, it's available as a method:
$this->io(); // IO
}
public function configure(): void
{
$this
->addArgument('username', InputArgument::REQUIRED)
->addOption('roles', mode: InputOption::VALUE_IS_ARRAY)
;
}
}