<?php

declare(strict_types=1);

namespace PpPhp\Core\Registry;

use PpPhp\Core\Registry\Contracts\RegistryInterface;

final class RegistryManager
{
    private array $registries = [];
    public function registerRegistry(string $name, RegistryInterface $registry): void
    {
        $this->registries[$name] = $registry;
    }
    public function registry(string $name): ?RegistryInterface
    {
        return $this->registries[$name] ?? null;
    }
    public function has(string $name): bool
    {
        return isset($this->registries[$name]);
    }
    public function all(): array
    {
        return $this->registries;
    }
}
