]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/iterator/registry/class_RegistryIterator.php
Continued:
[core.git] / framework / main / classes / iterator / registry / class_RegistryIterator.php
index 93d54fa86401658ecd0831efecc7e078a6657804..c01722adaf10f25a6b5593dc4aca107d7c1f9d4e 100644 (file)
@@ -39,7 +39,7 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry {
        /**
         * All found registry keys
         */
-       private $registryKeys = array();
+       private $registryKeys = [];
 
        /**
         * Current array key
@@ -109,7 +109,7 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry {
                $entries = $this->getRegistryInstance()->getGenericRegistry();
 
                // Init registry keys array
-               $this->registryKeys['generic'] = array();
+               $this->registryKeys['generic'] = [];
 
                // Anything in there?
                if (count($entries) > 0) {
@@ -121,7 +121,7 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry {
                $entries = $this->getRegistryInstance()->getInstanceRegistry();
 
                // Init registry keys array
-               $this->registryKeys['instance'] = array();
+               $this->registryKeys['instance'] = [];
 
                // Anything in there?
                if (count($entries) > 0) {
@@ -178,7 +178,7 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry {
                                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[instance]: key=%s,entry[]=%s - Adding ...', $key, gettype($entry)));
 
                                // Add key to array
-                               $this->registryKeys['instance'][$key] = array();
+                               $this->registryKeys['instance'][$key] = [];
                        } // END - foreach
                } // END - if
        }
@@ -233,6 +233,12 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry {
         * @return      void
         */
        public function rewind () {
+               // Is the registry empty?
+               if (count($this->registryKeys) == 0) {
+                       // Then no need to continue
+                       return;
+               } // END - if
+
                // Debugging:
                /* DEBUG-DIE: */ die(sprintf('[%s:%d]: this->key(%d)[%s]=%s,this->valid=%d,this->registryKeys=%s', __METHOD__, __LINE__, strlen($this->key()), gettype($this->key()), $this->key(), intval($this->valid()), print_r($this->registryKeys, TRUE)));
        }