for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Stu\Component\Cli;
use Ahc\Cli\Input\Command;
use Psr\Container\ContainerInterface;
use Stu\Component\Event\EventSchedulerInterface;
/**
* Provides cli method for manual event scheduling
*/
final class EventSchedulerCommand extends Command
{
public function __construct(
private ContainerInterface $dic
) {
parent::__construct(
'event:schedule',
'Runs the event scheduler'
);
$this
->usage(
'<bold> $0 event:schedule</end> <comment></end> ## Runs the event scheduler<eol/>'
}
public function execute(): void
$eventScheduler = $this->dic->get(EventSchedulerInterface::class);
$eventScheduler->processEvents();
$this->io()->ok(
'Event Scheduler has been executed',
true