<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\Console\Commands;

use PpPhp\Core\Platform\Console\AbstractCommand;

final class DistributedRuntimeFullCommand extends AbstractCommand
{
    public function name(): string { return 'distributed'; }
    public function description(): string { return 'PPphp Distributed Runtime'; }

    public function handle(array $arguments = []): int
    {
        $this->title('PPphp Distributed Runtime');
        $result = (new \PpPhp\Core\Platform\Event\Distributed\Validation\DistributedRuntimeFullVerifier())->verify(\PpPhp\Core\Platform\Console\ConsolePath::basePath()); $summary = $result['summary']; $this->line('Status: ' . ($result['ok'] ? 'PASS' : 'FAIL')); $this->line('Checks: ' . $summary['checks']); $this->line('Passed: ' . $summary['passed']); $this->line('Failed: ' . $summary['failed']); $this->line('Score: ' . $summary['score'] . '%'); return $result['ok'] ? 0 : 1;
    }
}
