From f50a4925104815949449aa566d4a2e301c36751b Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 6 Oct 2011 22:45:13 -0500 Subject: [PATCH] fixed bug in ioc container singleton resolution. --- laravel/container.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/laravel/container.php b/laravel/container.php index a5f5af06..6a7f07b8 100644 --- a/laravel/container.php +++ b/laravel/container.php @@ -179,7 +179,12 @@ public function resolve($name, $parameters = array()) $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; } } \ No newline at end of file