<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\Console\Commands;

use PpPhp\Core\Platform\Console\AbstractCommand;

final class RetryClearCommand extends AbstractCommand
{
    public function name(): string { return 'retry:clear'; }
    public function description(): string { return 'PPphp Retry Clear'; }

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