From 685f0e8e540ffb0a9f2001ddd451e0cf560f92b7 Mon Sep 17 00:00:00 2001 From: Nathanael Esayeas Date: Tue, 6 Feb 2024 12:13:11 -0600 Subject: [PATCH] Update Container.php Signed-off-by: Nathanael Esayeas --- src/Container.php | 3 +++ 1 file changed, 3 insertions(+) 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];