<?php

declare(strict_types=1);

namespace PpPhp\Core\Platform\Metadata\ValueObjects;

final class PlatformDescriptor
{
    public function __construct(
        private readonly array $properties = [],
        private readonly array $events = [],
        private readonly array $validationRules = [],
        private readonly array $examples = [],
        private readonly string $renderer = ''
    ) {}

    public function properties(): array
    {
        return $this->properties;
    }
    public function events(): array
    {
        return $this->events;
    }
    public function validationRules(): array
    {
        return $this->validationRules;
    }
    public function examples(): array
    {
        return $this->examples;
    }
    public function renderer(): string
    {
        return $this->renderer;
    }

    public function toArray(): array
    {
        return [
            'properties' => $this->properties,
            'events' => $this->events,
            'validation' => $this->validationRules,
            'examples' => $this->examples,
            'renderer' => $this->renderer,
        ];
    }
}
