<?php
declare(strict_types=1);

namespace App\Core;

final class ModuleRegistry
{
    private static array $modules = [];

    public static function register(string $moduleName, array $config): void
    {
        self::$modules[$moduleName] = $config;
    }

    public static function provides(string $moduleName): array
    {
        return self::$modules[$moduleName] ?? [];
    }

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

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