<?php
declare(strict_types=1);

namespace App\Core\Registries;

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

    public static function register(string $ruleName, callable $handler): void
    {
        self::$items[$ruleName] = ['handler' => $handler];
    }

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

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

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