Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Feb 28, 2020
1 parent cba2b53 commit 1764ff7
Showing 1 changed file with 15 additions and 18 deletions.
33 changes: 15 additions & 18 deletions src/Illuminate/Foundation/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -767,25 +767,11 @@ public function registerDeferredProvider($provider, $service = null)
*/
public function make($abstract, array $parameters = [])
{
$abstract = $this->getAlias($abstract);

$this->loadDeferredProviderIfNeeded($abstract);
$this->loadDeferredProviderIfNeeded($abstract = $this->getAlias($abstract));

return parent::make($abstract, $parameters);
}

/**
* Load deferred provider if $abstract is deferred service and instance was not loaded.
*
* @param string $abstract
*/
private function loadDeferredProviderIfNeeded($abstract)
{
if ($this->isDeferredService($abstract) && ! isset($this->instances[$abstract])) {
$this->loadDeferredProvider($abstract);
}
}

/**
* Resolve the given type from the container.
*
Expand All @@ -798,13 +784,24 @@ private function loadDeferredProviderIfNeeded($abstract)
*/
protected function resolve($abstract, $parameters = [], $raiseEvents = true)
{
$abstract = $this->getAlias($abstract);

$this->loadDeferredProviderIfNeeded($abstract);
$this->loadDeferredProviderIfNeeded($abstract = $this->getAlias($abstract));

return parent::resolve($abstract, $parameters, $raiseEvents);
}

/**
* Load the deferred provider if the given type is a deferred service and the instance has not been loaded.
*
* @param string $abstract
* @return void
*/
protected function loadDeferredProviderIfNeeded($abstract)
{
if ($this->isDeferredService($abstract) && ! isset($this->instances[$abstract])) {
$this->loadDeferredProvider($abstract);
}
}

/**
* Determine if the given abstract type has been bound.
*
Expand Down

0 comments on commit 1764ff7

Please sign in to comment.