66use Closure ;
77use Exception ;
88use Illuminate \Contracts \Container \BindingResolutionException ;
9- use Illuminate \Contracts \Container \CircularDependencyFoundException ;
9+ use Illuminate \Contracts \Container \CircularDependencyException ;
1010use Illuminate \Contracts \Container \Container as ContainerContract ;
1111use LogicException ;
1212use 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 ;
0 commit comments