]> 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 f8762d9aa25825f3b8e2e480bbbe0aacef24870d..6efdb0f4b15ec00a87a940445eb6625a5a573051 100644 (file)
@@ -278,10 +278,10 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry {
                //* DEBUG-DIE: */ 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)));
                if (!$this->valid()) {
                        // Bad method call!
-                       throw new BadMethodCallException(sprintf('this->key[%s]=%s is no longer valid, but method was called.', gettype($this->key()), $this->key()));
+                       throw new BadMethodCallException(sprintf('this->key[%s]=%s is no longer valid, but method was called.', gettype($this->key()), $this->key()), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                } elseif ((count($this->registryKeys['generic']) == 0) && (count($this->registryKeys['instance']) == 0)) {
                        // Both arrays are empty
-                       throw new BadMethodCallException('No array elements in "generic" and "instance" found but method called.');
+                       throw new BadMethodCallException('No array elements in "generic" and "instance" found but method called.', FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Default is not valid
@@ -305,7 +305,7 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[%s]: isNextValid=%d', $this->key(), intval($isNextValid)));
                if (!$isNextValid) {
                        // Throw exception
-                       throw new BadMethodCallException(sprintf('this->key=%s is last key in this iteration. Forgot to invoke valid() before?', $this->key()));
+                       throw new BadMethodCallException(sprintf('this->key=%s is last key in this iteration. Forgot to invoke valid() before?', $this->key()), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                } elseif ($registryType == 'invalid') {
                        // Not changed!
                        throw new UnexpectedValueException('registryType has not been changed.');
@@ -330,10 +330,10 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry {
                //* DEBUG-DIE: */ 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)));
                if (array_search($this->key(), $this->getRegistryKeys()) === 0) {
                        // rewind() cannot rewind first entry!
-                       throw new BadMethodCallException(sprintf('this->key=%s is already first element, but method was called.', $this->key()));
+                       throw new BadMethodCallException(sprintf('this->key=%s is already first element, but method was called.', $this->key()), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                } elseif ((count($this->registryKeys['generic']) == 0) && (count($this->registryKeys['instance']) == 0)) {
                        // Both arrays are empty
-                       throw new BadMethodCallException('No array elements in "generic" and "instance" found but method called.');
+                       throw new BadMethodCallException('No array elements in "generic" and "instance" found but method called.', FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Get first array element ...