Permalink
Browse files

Small simplification

  • Loading branch information...
flack committed Dec 3, 2018
1 parent c96f333 commit 44e6b31ed03346b75a96148d9f71948d80fd0f08
Showing with 4 additions and 13 deletions.
  1. +4 −13 lib/midcom/helper/_componentloader.php
@@ -60,14 +60,6 @@
*/
class midcom_helper__componentloader
{
/**
* This indexed array stores the MidCOM paths of all loaded
* components. Its elements are used as keys for the cache storage.
*
* @var Array
*/
private $_loaded = [];
/**
* This array contains a list of components that were tried to be loaded.
* The components are added to this list *even* if the system only tried
@@ -82,8 +74,8 @@ class midcom_helper__componentloader
private $_tried_to_load = [];
/**
* This is a part of the component cache. It stores the interface instances
* of the different loaded components, indexed by their MidCOM Path.
* This stores the interface instances of the different loaded components,
* indexed by their MidCOM Path.
*
* @var midcom_baseclasses_components_interface[]
*/
@@ -197,7 +189,6 @@ private function _load($path)
$this->_interface_classes[$path] = new $classname();
$this->_interface_classes[$path]->initialize($path);
$this->_loaded[] = $path;
$this->_tried_to_load[$path] = true;
return true;
@@ -216,7 +207,7 @@ public function is_loaded($path)
// MidCOM is "always loaded"
return true;
}
return in_array($path, $this->_loaded);
return array_key_exists($path, $this->_interface_classes);
}
/**
@@ -300,7 +291,7 @@ public function path_to_prefix($path)
*/
public function list_loaded_components()
{
return $this->_loaded;
return array_keys($this->_interface_classes);
}
/**

0 comments on commit 44e6b31

Please sign in to comment.