<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\Console\Commands;

use PpPhp\Core\Platform\Console\AbstractCommand;

final class StreamDlqRetryCommand extends AbstractCommand
{
    public function name(): string { return 'stream:dlq:retry'; }
    public function description(): string { return 'PPphp Stream DLQ Retry'; }

    public function handle(array $arguments = []): int
    {
        $this->title('PPphp Stream DLQ Retry');
        $result = \PpPhp\Core\Platform\Event\Streaming\Dlq\StreamDlqRuntime::instance(\PpPhp\Core\Platform\Console\ConsolePath::basePath())->retry(); $this->line('Retried: ' . $result->affected());
        return 0;
    }
}
