<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\Console\Commands;

use PpPhp\Core\Platform\Console\AbstractCommand;

final class BpmnRuntimeCommand extends AbstractCommand
{
    public function name(): string { return 'workflow:bpmn'; }
    public function description(): string { return 'PPphp BPMN Runtime'; }

    public function handle(array $arguments = []): int
    {
        $this->title('PPphp BPMN Runtime');
        $runtime = \PpPhp\Core\Platform\Workflow\Bpmn\BpmnRuntime::instance(\PpPhp\Core\Platform\Console\ConsolePath::basePath()); $summary = $runtime->summary(); $stats = $summary['statistics']; $this->line('Models: ' . ($stats['models'] ?? 0)); $this->line('Designer Models: ' . ($stats['designerModels'] ?? 0)); $this->line('Imports: ' . ($stats['imports'] ?? 0)); $this->line('Exports: ' . ($stats['exports'] ?? 0)); $this->line('Persisted: ' . ($summary['persisted'] ? 'YES' : 'NO')); $this->line('Status: OK');
        return 0;
    }
}
