#[AsCommand(name: 'debug:scheduler', description: 'List schedules and their recurring messages')]
final class DebugCommand extends Command
{ private array
$scheduleNames;
public function __construct(private ServiceProviderInterface
$schedules) { $this->scheduleNames =
array_keys($this->schedules->
getProvidedServices());
parent::
__construct();
} protected function configure(): void
{ $this ->
addArgument('schedule', InputArgument::OPTIONAL | InputArgument::IS_ARRAY,
sprintf('The schedule name (one of "%s")',
implode('", "',
$this->scheduleNames
)), null,
$this->scheduleNames
) ->
addOption('date', null, InputOption::VALUE_REQUIRED, 'The date to use for the next run date', 'now'
) ->
addOption('all', null, InputOption::VALUE_NONE, 'Display all recurring messages, including the terminated ones'
) ->
setHelp(<<<'EOF'