<?php
declare(strict_types=1);

namespace App\Core\Registries;

final class FieldTypeRegistry
{
    private static array $items = [];

    public static function register(string $typeCode, array $definition): void
    {
        self::$items[$typeCode] = $definition;
    }

    public static function get(string $typeCode): ?array
    {
        return self::$items[$typeCode] ?? null;
    }

    public static function getAll(): array
    {
        return self::$items;
    }

    public static function has(string $typeCode): bool
    {
        return isset(self::$items[$typeCode]);
    }
}