<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\Kernel\Legacy;

use PpPhp\Core\Platform\Kernel\Facades\Registry;
use PpPhp\Core\Platform\Services\Definition\ServiceDefinition;

final class LegacyRegistryFacade
{
    public function register(ServiceDefinition $definition): void
    {
        Registry::register($definition);
    }

    public function has(string $id): bool
    {
        return Registry::has($id);
    }

    public function get(string $id): ?ServiceDefinition
    {
        return Registry::get($id);
    }

    public function all(): array
    {
        return Registry::all();
    }
}
