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

View File

@@ -179,7 +179,12 @@ class Container {
$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;
} }
} }