<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\Console\Commands;

use PpPhp\Core\Platform\Console\AbstractCommand;
use PpPhp\Core\Platform\Event\Lifecycle\LifecycleEventManifest;

final class LifecycleCommand extends AbstractCommand
{
    public function name(): string { return 'lifecycle'; }
    public function description(): string { return 'Show lifecycle event overview.'; }

    public function handle(array $arguments = []): int
    {
        $registry = LifecycleEventManifest::registry();
        $this->title('PPphp Lifecycle Events');
        $this->line('Events: ' . $registry->count());
        $this->line('Categories: ' . count($registry->categories()));
        $this->line('Status: OK');
        return 0;
    }
}
