]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/lists/class_BaseList.php
Introduced self::createDebugInstance()
[hub.git] / application / hub / main / lists / class_BaseList.php
index 4def45ba530257e515d55456a5e2e9cf6302c980..c4d18376846e9e10567102343be1795440c73a0a 100644 (file)
@@ -82,7 +82,7 @@ class BaseList extends BaseHubSystem implements IteratorAggregate, Countable {
         * @return      $isset          Whether the group is valid
         */
        public function isGroupSet ($groupName) {
-               //* DEBUG: */ $this->debugOutput(__METHOD__.': '.$groupName);
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.': '.$groupName);
                return isset($this->listGroups[$groupName]);
        }
 
@@ -94,7 +94,7 @@ class BaseList extends BaseHubSystem implements IteratorAggregate, Countable {
         * @throws      ListGroupAlreadyAddedException  If the given group is already added
         */
        public function addGroup ($groupName) {
-               //* DEBUG: */ $this->debugOutput(__METHOD__.': '.$groupName . ' - START');
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.': '.$groupName . ' - START');
                // Is the group already added?
                if ($this->isGroupSet($groupName)) {
                        // Throw the exception here
@@ -103,7 +103,7 @@ class BaseList extends BaseHubSystem implements IteratorAggregate, Countable {
 
                // Add the group which is a simple array
                $this->listGroups[$groupName] = ObjectFactory::createObjectByConfiguredName('list_group_class');
-               //* DEBUG: */ $this->debugOutput(__METHOD__.': '.$groupName . ' - FINISHED');
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.': '.$groupName . ' - FINISHED');
        }
 
        /**
@@ -116,7 +116,7 @@ class BaseList extends BaseHubSystem implements IteratorAggregate, Countable {
         * @throws      NoListGroupException    If the given group is not found
         */
        public function addInstance ($groupName, $subGroup, Visitable $instance) {
-               //* DEBUG: */ $this->debugOutput(__METHOD__.': '.$groupName  . '/' . $subGroup . ' - START');
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.': '.$groupName  . '/' . $subGroup . ' - START');
                // Is the group there?
                if (!$this->isGroupSet($groupName)) {
                        // Throw the exception here
@@ -140,7 +140,7 @@ class BaseList extends BaseHubSystem implements IteratorAggregate, Countable {
 
                // Add the instance itself to the list
                $this->listEntries[$hash] = $instance;
-               //* DEBUG: */ $this->debugOutput(__METHOD__.': '.$groupName  . '/' . $subGroup . ' - FINISHED');
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.': '.$groupName  . '/' . $subGroup . ' - FINISHED');
        }
 
        /**
@@ -190,7 +190,7 @@ class BaseList extends BaseHubSystem implements IteratorAggregate, Countable {
         * @throws      NoListGroupException    If the given group is not found
         */
        public function addEntry ($groupName, $entry) {
-               //* DEBUG: */ $this->debugOutput(__METHOD__.'('.$this->__toString().'): '.$groupName . ' - START');
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.'('.$this->__toString().'): '.$groupName . ' - START');
                // Is the group already added?
                if (!$this->isGroupSet($groupName)) {
                        // Throw the exception here
@@ -199,7 +199,7 @@ class BaseList extends BaseHubSystem implements IteratorAggregate, Countable {
 
                // Generate hash
                $hash = $this->generateHash($groupName, $groupName, $entry);
-               //* DEBUG: */ $this->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']:  groupName=' . $groupName . ', entry=' . $entry . ', hash=' . $hash);
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']:  groupName=' . $groupName . ', entry=' . $entry . ', hash=' . $hash);
 
                // Add the hash to the index
                $this->listIndex[] = $hash;
@@ -208,7 +208,7 @@ class BaseList extends BaseHubSystem implements IteratorAggregate, Countable {
                // Now add the entry to the list
                $this->listEntries[$hash] = $entry;
                //* DEBUG: */ print $groupName.'/'.count($this->listEntries).chr(10);
-               //* DEBUG: */ $this->debugOutput(__METHOD__.'('.$this->__toString().'): '.$groupName . ' - FINISHED');
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.'('.$this->__toString().'): '.$groupName . ' - FINISHED');
        }
 
        /**
@@ -220,7 +220,7 @@ class BaseList extends BaseHubSystem implements IteratorAggregate, Countable {
         * @throws      NoListGroupException    If the given group is not found
         */
        public function removeEntry ($groupName, $entry) {
-               //* DEBUG: */ $this->debugOutput(__METHOD__.'('.$this->__toString().'): '.$groupName . ' - START');
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.'('.$this->__toString().'): '.$groupName . ' - START');
                // Is the group already added?
                if (!$this->isGroupSet($groupName)) {
                        // Throw the exception here
@@ -229,14 +229,14 @@ class BaseList extends BaseHubSystem implements IteratorAggregate, Countable {
 
                // Generate hash
                $hash = $this->generateHash($groupName, $groupName, $entry);
-               //* DEBUG: */ $this->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']:  groupName=' . $groupName . ', entry=' . $entry . ', hash=' . $hash);
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']:  groupName=' . $groupName . ', entry=' . $entry . ', hash=' . $hash);
 
                // Remove it from the list ...
                unset($this->listEntries[$hash]);
 
                // ... and hash list as well
                unset($this->listIndex[array_search($hash, $this->listIndex)]);
-               //* DEBUG: */ $this->debugOutput(__METHOD__.'('.$this->__toString().'): '.$groupName . ' - FINISHED');
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.'('.$this->__toString().'): '.$groupName . ' - FINISHED');
        }
 
        /**
@@ -271,7 +271,7 @@ class BaseList extends BaseHubSystem implements IteratorAggregate, Countable {
                        $entry2 = crc32($entry[BasePool::SOCKET_ARRAY_RESOURCE] . ':' . $entry[BasePool::SOCKET_ARRAY_CONN_TYPE]);
                } else {
                        // Unsupported type detected
-                       $this->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: Entry type ' . gettype($entry) . ' is unsupported.');
+                       self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: Entry type ' . gettype($entry) . ' is unsupported.');
 
                        // @TODO Extend this somehow?
                        $entry2 = gettype($entry);
@@ -415,7 +415,7 @@ class BaseList extends BaseHubSystem implements IteratorAggregate, Countable {
                        $entry = $this->getEntry($entryIndex);
 
                        // Debug message
-                       //* NOISY-DEBUG: */ $this->debugOutput('LIST: Adding entry ' . $entry . ' ...');
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('LIST: Adding entry ' . $entry . ' ...');
 
                        // Add it to the list
                        $entries[$iteratorInstance->current()] = $entry;