<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\Console\Commands;

use PpPhp\Core\Platform\Console\AbstractCommand;

final class StreamDlqVerifyCommand extends AbstractCommand
{
    public function name(): string { return 'stream:dlq:verify'; }
    public function description(): string { return 'PPphp Stream DLQ Verification'; }

    public function handle(array $arguments = []): int
    {
        $this->title('PPphp Stream DLQ Verification');
        $result = (new \PpPhp\Core\Platform\Event\Streaming\Dlq\Validation\StreamDlqVerifier())->verify(\PpPhp\Core\Platform\Console\ConsolePath::basePath()); foreach ($result['checks'] as $check => $ok) { $this->line('[' . ($ok ? 'PASS' : 'FAIL') . '] ' . $check); } $this->line('Score: ' . ($result['summary']['score'] ?? 0) . '%'); return $result['ok'] ? 0 : 1;
        return 0;
    }
}
