Permalink
Browse files

Merge branch 'feature/further-asset-manager-fixes' into develop

  • Loading branch information...
2 parents f201ce8 + b54f4de commit 588f4bd5a886414dc6401b7c5bfd32fd4c934f36 @trq trq committed Feb 6, 2013
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/Proem/Service/AssetManager.php
View
8 lib/Proem/Service/AssetManager.php
@@ -134,6 +134,12 @@ public function attach($name, $resolver = null, $single = false, $override = fal
$this->setParam('assets', $name, $name, $override);
}
+ // If we have a singleton, make sure it is only in
+ // the *instances* array and not within *aliases*.
+ if ($single && isset($this->aliases[$name])) {
+ unset($this->aliases[$name]);
+ }
+
return $this;
}
@@ -227,10 +233,12 @@ public function resolve($name, $params = [])
// Attempt to resolve by name.
$object = $this->autoResolve($name, $params);
$this->setParam('instances', $name, $object, true);
+ return $this->resolve($name);
} catch (\LogicException $e) {
try {
$object = $this->autoResolve($this->instances[$name], $params);
$this->setParam('instances', $name, $object, true);
+ return $this->resolve($name);
} catch (\LogicException $e) {
throw $e;
}

0 comments on commit 588f4bd

Please sign in to comment.