<?php

declare(strict_types=1);

namespace PpPhp\Core\Platform\Catalog\Definitions;

use PpPhp\Core\Platform\Catalog\Contracts\CatalogDefinitionInterface;
use PpPhp\Core\Platform\Identity\PlatformIdentity;
use PpPhp\Core\Platform\Metadata\ValueObjects\PlatformDescriptor;
use PpPhp\Core\Platform\Metadata\ValueObjects\PlatformMetadata;

abstract class AbstractCatalogDefinition implements CatalogDefinitionInterface
{
    protected function __construct(
        protected readonly PlatformIdentity $identity,
        protected readonly PlatformMetadata $metadata,
        protected readonly ?PlatformDescriptor $descriptor = null,
        protected array $defaults = [],
        protected ?string $renderer = null
    ) {}

    public function identity(): PlatformIdentity
    {
        return $this->identity;
    }

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

    public function descriptor(): ?PlatformDescriptor
    {
        return $this->descriptor;
    }

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

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