Skip to content

Commit

Permalink
Merge pull request #11950 from lucasmichot/feature/5.2/is-shared
Browse files Browse the repository at this point in the history
[5.2] isShared : no need to check instances AND bindings
  • Loading branch information
taylorotwell committed Jan 19, 2016
2 parents 30a1c93 + 6e7d15b commit 3b60cc4
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/Illuminate/Container/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -1046,13 +1046,15 @@ public function isShared($abstract)
{
$abstract = $this->normalize($abstract);

if (isset($this->bindings[$abstract]['shared'])) {
$shared = $this->bindings[$abstract]['shared'];
} else {
$shared = false;
if (isset($this->instances[$abstract])) {
return true;
}

if (! isset($this->bindings[$abstract]['shared'])) {
return false;
}

return isset($this->instances[$abstract]) || $shared === true;
return $this->bindings[$abstract]['shared'] === true;
}

/**
Expand Down

0 comments on commit 3b60cc4

Please sign in to comment.