fixed bug in ioc container singleton resolution.

This commit is contained in:
Taylor Otwell 2011-10-06 22:45:13 -05:00
parent 2c2dcdc502
commit f50a492510
1 changed files with 6 additions and 1 deletions

View File

@ -179,7 +179,12 @@ public function resolve($name, $parameters = array())
$object = call_user_func($this->registry[$name]['resolver'], $this, $parameters); $object = call_user_func($this->registry[$name]['resolver'], $this, $parameters);
return (isset($this->registry[$name]['singleton'])) ? $this->singletons[$name] = $object : $object; if (isset($this->registry[$name]['singleton']) and $this->registry[$name]['singleton'])
{
return $this->singletons[$name] = $object;
}
return $object;
} }
} }