<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\Console\Commands;

use PpPhp\Core\Platform\Console\AbstractCommand;
use PpPhp\Core\Platform\Kernel\Platform;

final class ManifestsCommand extends AbstractCommand
{
    public function name(): string { return 'manifests'; }
    public function description(): string { return 'List discovered manifests.'; }

    public function handle(array $arguments = []): int
    {
        $this->title('PPphp Manifests');
        foreach (Platform::manifests()->all() as $manifest) {
            $this->line('- ' . $manifest->type() . ': ' . $manifest->id() . ' (' . $manifest->label() . ')');
        }
        return 0;
    }
}
