]> git.mxchange.org Git - core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sat, 25 Feb 2023 11:37:16 +0000 (12:37 +0100)
committerRoland Häder <roland@mxchange.org>
Sat, 25 Feb 2023 11:39:53 +0000 (12:39 +0100)
- tried to fix NPE, still not working?
- added debug log
- better logging

framework/main/classes/iterator/registry/class_RegistryIterator.php

index 40e79884fe1c0cb6cdbdf0321783baa8bad35f56..2e94bcf9784c91203bc82550b5ea5e5e0c56215e 100644 (file)
@@ -245,6 +245,7 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry {
                }
 
                // Is current still NULL?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('REGISTRY-ITERATOR[%s]: registryKey=%s,current[]=%s', $this->key(), $registryKey, gettype($current)));
                if (is_null($current)) {
                        // This cannot happen and indicates a logic error
                        throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
@@ -262,7 +263,7 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry {
         */
        public function key () {
                // Return it
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('REGISTRY-ITERATOR[%s]: EXIT!', $this->key));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('REGISTRY-ITERATOR: this->key=%s EXIT!', $this->key));
                return $this->key;
        }
 
@@ -313,6 +314,7 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry {
                }
 
                // Yes, then advance to that entry
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('REGISTRY-ITERATOR: Setting this->key from this->registryKeys[%s][%d] ...', $registryType, $nextIndex));
                $this->key = $this->registryKeys[$registryType][$nextIndex];
 
                // Trace message
@@ -344,6 +346,7 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry {
                        /* UNFINISHED */ ApplicationEntryPoint::exitApplication(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)));
                } elseif (count($this->registryKeys['instance']) > 0) {
                        // Second instance
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('REGISTRY-ITERATOR: Setting this->key from this->registryKeys[instance][0] ...');
                        $this->key = $this->registryKeys['instance'][0];
                }