<?php

declare(strict_types=1);

namespace App\Framework\DI;

use App\Framework\Core\ValueObjects\ClassName;

interface Container
{
    public MethodInvoker $invoker {get;}

    public ContainerIntrospector $introspector {get;}

    /**
     * @template T of object
     * @param class-string<T>|ClassName $class
     * @return T
     */
    public function get(string|ClassName $class): object;

    /** @param class-string $class */
    public function has(string $class): bool;

    public function bind(string $abstract, callable|string|object $concrete): void;

    public function singleton(string $abstract, callable|string|object $concrete): void;

    public function instance(string $abstract, object $instance): void;

    /** @param class-string $class */
    public function forget(string $class): void;
}
