<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\DI\Contracts;

interface DefinitionInterface
{
    public function id(): string;
    public function type(): string;
    public function lifetime(): string;
    public function visibility(): string;
    public function lazy(): bool;
    public function tags(): array;
    public function aliases(): array;
    public function metadata(): array;
    public function withLifetime(string $lifetime): self;
    public function withVisibility(string $visibility): self;
    public function withLazy(bool $lazy = true): self;
    public function withTag(string $tag, array $attributes = []): self;
    public function withAlias(string $alias): self;
    public function withMetadata(string $key, mixed $value): self;
    public function resolve(ContainerInterface $container, ResolverInterface $resolver): mixed;
    public function toArray(): array;
}
