Skip to content

Commit

Permalink
Update Container.php
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 72f9edf commit 685f0e8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,9 @@ 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;
}

if (array_key_exists($class, $this->instances)) {
return $this->instances[$class];
Expand Down

0 comments on commit 685f0e8

Please sign in to comment.