<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\Console\Commands;

use PpPhp\Core\Platform\Console\AbstractCommand;

final class RetryFailedCommand extends AbstractCommand
{
    public function name(): string { return 'retry:failed'; }
    public function description(): string { return 'PPphp Retry Failed Events'; }

    public function handle(array $arguments = []): int
    {
        $this->title('PPphp Retry Failed Events');
        $runtime = new \PpPhp\Core\Platform\Event\Retry\RetryRuntime(); $this->line('Failed: ' . $runtime->deadLetters()->count());
        return 0;
    }
}
