diff --git a/src/Container.php b/src/Container.php index 29d75ae..1b23835 100644 --- a/src/Container.php +++ b/src/Container.php @@ -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];