6
6
use Closure ;
7
7
use Exception ;
8
8
use Illuminate \Contracts \Container \BindingResolutionException ;
9
- use Illuminate \Contracts \Container \CircularDependencyFoundException ;
9
+ use Illuminate \Contracts \Container \CircularDependencyException ;
10
10
use Illuminate \Contracts \Container \Container as ContainerContract ;
11
11
use LogicException ;
12
12
use ReflectionClass ;
@@ -660,7 +660,7 @@ public function get($id)
660
660
try {
661
661
return $ this ->resolve ($ id );
662
662
} catch (Exception $ e ) {
663
- if ($ this ->has ($ id ) || $ e instanceof CircularDependencyFoundException ) {
663
+ if ($ this ->has ($ id ) || $ e instanceof CircularDependencyException ) {
664
664
throw $ e ;
665
665
}
666
666
@@ -671,13 +671,13 @@ public function get($id)
671
671
/**
672
672
* Resolve the given type from the container.
673
673
*
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
677
677
* @return mixed
678
678
*
679
679
* @throws \Illuminate\Contracts\Container\BindingResolutionException
680
- * @throws \Illuminate\Contracts\Container\CircularDependencyFoundException
680
+ * @throws \Illuminate\Contracts\Container\CircularDependencyException
681
681
*/
682
682
protected function resolve ($ abstract , $ parameters = [], $ raiseEvents = true )
683
683
{
@@ -814,11 +814,11 @@ protected function isBuildable($concrete, $abstract)
814
814
/**
815
815
* Instantiate a concrete instance of the given type.
816
816
*
817
- * @param \Closure|string $concrete
817
+ * @param \Closure|string $concrete
818
818
* @return mixed
819
819
*
820
820
* @throws \Illuminate\Contracts\Container\BindingResolutionException
821
- * @throws \Illuminate\Contracts\Container\CircularDependencyFoundException
821
+ * @throws \Illuminate\Contracts\Container\CircularDependencyException
822
822
*/
823
823
public function build ($ concrete )
824
824
{
@@ -842,9 +842,8 @@ public function build($concrete)
842
842
return $ this ->notInstantiable ($ concrete );
843
843
}
844
844
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 }]. " );
848
847
}
849
848
850
849
$ this ->buildStack [] = $ concrete ;
0 commit comments