From 332844e5bde34f8db91aeca4d21cd4e0925d691e Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 16 Mar 2021 14:42:13 -0500 Subject: [PATCH] revert circular dep --- src/Illuminate/Container/Container.php | 6 +++--- tests/Container/ContainerTest.php | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Illuminate/Container/Container.php b/src/Illuminate/Container/Container.php index 4ea378983d0d..642d1e082e6d 100755 --- a/src/Illuminate/Container/Container.php +++ b/src/Illuminate/Container/Container.php @@ -842,9 +842,9 @@ public function build($concrete) return $this->notInstantiable($concrete); } - if (in_array($concrete, $this->buildStack)) { - throw new CircularDependencyException("Circular dependency detected while resolving [{$concrete}]."); - } + // if (in_array($concrete, $this->buildStack)) { + // throw new CircularDependencyException("Circular dependency detected while resolving [{$concrete}]."); + // } $this->buildStack[] = $concrete; diff --git a/tests/Container/ContainerTest.php b/tests/Container/ContainerTest.php index 39638694f802..eefe9366cbfc 100755 --- a/tests/Container/ContainerTest.php +++ b/tests/Container/ContainerTest.php @@ -564,13 +564,13 @@ public function testContainerCanResolveClasses() $this->assertInstanceOf(ContainerConcreteStub::class, $class); } - public function testContainerCanCatchCircularDependency() - { - $this->expectException(CircularDependencyException::class); + // public function testContainerCanCatchCircularDependency() + // { + // $this->expectException(CircularDependencyException::class); - $container = new Container; - $container->get(CircularAStub::class); - } + // $container = new Container; + // $container->get(CircularAStub::class); + // } } class CircularAStub