Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/Illuminate/Container/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ protected function getClosure($abstract, $concrete)
return $container->build($concrete);
}

return $container->make($concrete, $parameters);
// To prevent extra call to resolving callbacks, we make the object silently.
return $container->resolve($concrete, $parameters, true);
};
}

Expand Down Expand Up @@ -630,9 +631,10 @@ public function get($id)
*
* @param string $abstract
* @param array $parameters
* @param bool $silent
* @return mixed
*/
protected function resolve($abstract, $parameters = [])
protected function resolve($abstract, $parameters = [], $silent = false)
{
$abstract = $this->getAlias($abstract);

Expand Down Expand Up @@ -674,8 +676,9 @@ protected function resolve($abstract, $parameters = [])
$this->instances[$abstract] = $object;
}

$this->fireResolvingCallbacks($abstract, $object);

if (! $silent) {
$this->fireResolvingCallbacks($abstract, $object);
}
// Before returning, we will also set the resolved flag to "true" and pop off
// the parameter overrides for this build. After those two things are done
// we will be ready to return back the fully constructed class instance.
Expand Down
Loading