<?php
declare(strict_types=1);

namespace App\Core\Registries;

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

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

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

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

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