Skip to content

Commit

Permalink
ObjectRegistry should use aliased class name for missing class exception
Browse files Browse the repository at this point in the history
  • Loading branch information
majna committed Jun 13, 2014
1 parent 1f7d91c commit 85e5b37
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Utility/ObjectRegistry.php
Expand Up @@ -69,13 +69,12 @@ public function load($objectName, $config = []) {
return $this->_loaded[$name];
}
if (is_array($config) && isset($config['className'])) {
$className = $this->_resolveClassName($config['className']);
}
if (!isset($className)) {
$className = $this->_resolveClassName($objectName);
$objectName = $config['className'];
}
$className = $this->_resolveClassName($objectName);
if (!$className) {
$this->_throwMissingClassError($objectName, substr($plugin, 0, -1));
list($plugin, $objectName) = pluginSplit($objectName);
$this->_throwMissingClassError($objectName, $plugin);
}
$instance = $this->_create($className, $name, $config);
$this->_loaded[$name] = $instance;
Expand Down

0 comments on commit 85e5b37

Please sign in to comment.