Skip to content

Commit

Permalink
Alias ContainerInterface
Browse files Browse the repository at this point in the history
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
  • Loading branch information
ghostwriter committed Feb 6, 2024
1 parent 685f0e8 commit 1752d1d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ final class Container implements ContainerInterface
/**
* @var array<string,string>
*/
private array $aliases = [];
private array $aliases = [
ContainerInterface::class => self::class,
];

/**
* @var array<class-string,array<class-string,class-string>>
Expand Down Expand Up @@ -114,10 +116,7 @@ private function __construct()

$this->parameterBuilder = ParameterBuilder::new($this);

$this->instantiator = Instantiator::new(
$this->reflector,
$this->parameterBuilder
);
$this->instantiator = Instantiator::new($this->reflector, $this->parameterBuilder);
}

/**
Expand Down Expand Up @@ -400,6 +399,7 @@ public function factory(string $service, string $serviceFactory): void
public function get(string $service): object
{
$class = $this->resolve($service);

if (is_a($service, ContainerInterface::class, true)) {
return $this;
}
Expand Down

0 comments on commit 1752d1d

Please sign in to comment.