<?php

declare(strict_types=1);

namespace PpPhp\Core\Platform\Services\Metadata;

use PpPhp\Core\Platform\Services\Contracts\CapabilityInterface;

final class CapabilityMetadata implements CapabilityInterface
{
    public function __construct(
        private readonly string $id,
        private readonly string $label,
        private readonly string $version = '1.0.0',
        private readonly string $description = '',
        private readonly string $maturity = 'stable',
        private readonly bool $experimental = false,
        private readonly array $metadata = []
    ) {
    }

    public function id(): string { return $this->id; }

    public function label(): string { return $this->label; }

    public function version(): string { return $this->version; }

    public function description(): string { return $this->description; }

    public function maturity(): string { return $this->maturity; }

    public function experimental(): bool { return $this->experimental; }

    public function metadata(): array { return $this->metadata; }

    public function toArray(): array
    {
        return [
            'id' => $this->id,
            'label' => $this->label,
            'version' => $this->version,
            'description' => $this->description,
            'maturity' => $this->maturity,
            'experimental' => $this->experimental,
            'metadata' => $this->metadata,
        ];
    }
}
