Skip to content

Commit a712f72

Browse files
committed
formatting
1 parent 0f79023 commit a712f72

File tree

3 files changed

+12
-24
lines changed

3 files changed

+12
-24
lines changed

src/Illuminate/Container/Container.php

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use Closure;
77
use Exception;
88
use Illuminate\Contracts\Container\BindingResolutionException;
9-
use Illuminate\Contracts\Container\CircularDependencyFoundException;
9+
use Illuminate\Contracts\Container\CircularDependencyException;
1010
use Illuminate\Contracts\Container\Container as ContainerContract;
1111
use LogicException;
1212
use ReflectionClass;
@@ -660,7 +660,7 @@ public function get($id)
660660
try {
661661
return $this->resolve($id);
662662
} catch (Exception $e) {
663-
if ($this->has($id) || $e instanceof CircularDependencyFoundException) {
663+
if ($this->has($id) || $e instanceof CircularDependencyException) {
664664
throw $e;
665665
}
666666

@@ -671,13 +671,13 @@ public function get($id)
671671
/**
672672
* Resolve the given type from the container.
673673
*
674-
* @param string|callable $abstract
675-
* @param array $parameters
676-
* @param bool $raiseEvents
674+
* @param string|callable $abstract
675+
* @param array $parameters
676+
* @param bool $raiseEvents
677677
* @return mixed
678678
*
679679
* @throws \Illuminate\Contracts\Container\BindingResolutionException
680-
* @throws \Illuminate\Contracts\Container\CircularDependencyFoundException
680+
* @throws \Illuminate\Contracts\Container\CircularDependencyException
681681
*/
682682
protected function resolve($abstract, $parameters = [], $raiseEvents = true)
683683
{
@@ -814,11 +814,11 @@ protected function isBuildable($concrete, $abstract)
814814
/**
815815
* Instantiate a concrete instance of the given type.
816816
*
817-
* @param \Closure|string $concrete
817+
* @param \Closure|string $concrete
818818
* @return mixed
819819
*
820820
* @throws \Illuminate\Contracts\Container\BindingResolutionException
821-
* @throws \Illuminate\Contracts\Container\CircularDependencyFoundException
821+
* @throws \Illuminate\Contracts\Container\CircularDependencyException
822822
*/
823823
public function build($concrete)
824824
{
@@ -842,9 +842,8 @@ public function build($concrete)
842842
return $this->notInstantiable($concrete);
843843
}
844844

845-
// Check for circular dependencies
846-
if(in_array($concrete, $this->buildStack)) {
847-
throw new CircularDependencyFoundException("Circular dependency while initiating [{$concrete}]");
845+
if (in_array($concrete, $this->buildStack)) {
846+
throw new CircularDependencyException("Circular dependency detected while resolving [{$concrete}].");
848847
}
849848

850849
$this->buildStack[] = $concrete;

src/Illuminate/Contracts/Container/CircularDependencyFoundException.php

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/Container/ContainerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Illuminate\Container\Container;
66
use Illuminate\Container\EntryNotFoundException;
77
use Illuminate\Contracts\Container\BindingResolutionException;
8-
use Illuminate\Contracts\Container\CircularDependencyFoundException;
8+
use Illuminate\Contracts\Container\CircularDependencyException;
99
use PHPUnit\Framework\TestCase;
1010
use Psr\Container\ContainerExceptionInterface;
1111
use stdClass;
@@ -565,7 +565,7 @@ public function testContainerCanResolveClasses()
565565
}
566566

567567
public function testContainerCanCatchCircularDependency() {
568-
$this->expectException(CircularDependencyFoundException::class);
568+
$this->expectException(CircularDependencyException::class);
569569

570570
$container = new Container;
571571
$container->get(CircularAStub::class);

0 commit comments

Comments
 (0)