]> git.mxchange.org Git - core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sat, 18 Feb 2023 00:44:39 +0000 (01:44 +0100)
committerRoland Häder <roland@mxchange.org>
Sat, 18 Feb 2023 00:44:39 +0000 (01:44 +0100)
- introduced new exception code EXCEPTION_LOGIC_EXCEPTION

framework/main/classes/file_directories/class_BaseFileIo.php
framework/main/classes/file_directories/input/raw/class_FrameworkRawFileInputPointer.php
framework/main/classes/file_directories/input/text/class_FrameworkTextFileInputPointer.php
framework/main/classes/file_directories/output/raw/class_FrameworkRawFileOutputPointer.php
framework/main/classes/file_directories/output/text/class_FrameworkTextFileOutputPointer.php
framework/main/classes/iterator/registry/class_RegistryIterator.php
framework/main/classes/utils/crypto/class_CryptoUtils.php
framework/main/interfaces/class_FrameworkInterface.php

index 3dfab5b62ed2dd3f0d5f9403e9a0e314ca548d41..f167f94ca7a20b60763d6dd6796286d039615094 100644 (file)
@@ -5,6 +5,7 @@ namespace Org\Mxchange\CoreFramework\Filesystem;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Filesystem\CloseableFile;
 use Org\Mxchange\CoreFramework\Filesystem\FilePointer;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\NullPointerException;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 
@@ -88,7 +89,7 @@ abstract class BaseFileIo extends BaseFrameworkSystem implements FilePointer, Cl
                        throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
                } elseif (!is_object($this->getFileObject())) {
                        // Pointer is not a valid resource!
-                       throw new LogicException(sprintf('this->fileObject[]=%s is no object', gettype($this->getFileObject())));
+                       throw new LogicException(sprintf('this->fileObject[]=%s is no object', gettype($this->getFileObject())), FrameworkInterface::EXCEPTION_LOGIC_EXCEPTION);
                }
 
                // Close the file pointer by NULL-ing it
index d17a77c502ffdbfcedbff07c7f818f127ab8633b..df6cc812deea4627688304af1ddd1317669ca12b 100644 (file)
@@ -9,6 +9,7 @@ use Org\Mxchange\CoreFramework\Filesystem\FileIoException;
 use Org\Mxchange\CoreFramework\Filesystem\FileNotFoundException;
 use Org\Mxchange\CoreFramework\Filesystem\FileReadProtectedException;
 use Org\Mxchange\CoreFramework\Filesystem\Pointer\InputPointer;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\NullPointerException;
 use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
@@ -113,7 +114,7 @@ class FrameworkRawFileInputPointer extends BaseFileIo implements InputPointer {
                        throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
                } elseif (!is_object($this->getFileObject())) {
                        // Pointer is not a valid resource!
-                       throw new LogicException(sprintf('this->fileObject[]=%s is no object', gettype($this->getFileObject())));
+                       throw new LogicException(sprintf('this->fileObject[]=%s is no object', gettype($this->getFileObject())), FrameworkInterface::EXCEPTION_LOGIC_EXCEPTION);
                }
 
                // Read data from the file pointer and return it
index dee8f18724b7c5335df159822bed34e5c37422f7..1998583754986df452db1fc08f17bda967e49c0d 100644 (file)
@@ -9,6 +9,7 @@ use Org\Mxchange\CoreFramework\Filesystem\FileIoException;
 use Org\Mxchange\CoreFramework\Filesystem\FileNotFoundException;
 use Org\Mxchange\CoreFramework\Filesystem\FileReadProtectedException;
 use Org\Mxchange\CoreFramework\Filesystem\Pointer\InputPointer;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\NullPointerException;
 use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
@@ -133,7 +134,7 @@ class FrameworkTextFileInputPointer extends BaseFileIo implements InputPointer {
                        throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
                } elseif (!is_object($this->getFileObject())) {
                        // Pointer is not a valid resource!
-                       throw new LogicException(sprintf('this->fileObject[]=%s is no object', gettype($this->getFileObject())));
+                       throw new LogicException(sprintf('this->fileObject[]=%s is no object', gettype($this->getFileObject())), FrameworkInterface::EXCEPTION_LOGIC_EXCEPTION);
                }
 
                // Is $bytes set?
index 9c242a1128021bf3c1cf8261fb3d8287e3f28e31..638ab2d2571974f6abf5a4e9da6d867b8d245baf 100644 (file)
@@ -109,7 +109,7 @@ class FrameworkRawFileOutputPointer extends BaseFileIo implements OutputPointer
                        throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
                } elseif (!is_object($this->getFileObject())) {
                        // Pointer is not a valid resource!
-                       throw new LogicException(sprintf('this->fileObject[]=%s is no object', gettype($this->getFileObject())));
+                       throw new LogicException(sprintf('this->fileObject[]=%s is no object', gettype($this->getFileObject())), FrameworkInterface::EXCEPTION_LOGIC_EXCEPTION);
                }
 
                // Write data to the file pointer and return written bytes
index 0df017c4b7c1d057ac9485759d0cab29cf116390..a70f7586b870dbd07a491c2688d0f38e17cb8809 100644 (file)
@@ -106,7 +106,7 @@ class FrameworkTextFileOutputPointer extends BaseFileIo implements OutputPointer
                        throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
                } elseif (!is_object($this->getFileObject())) {
                        // Pointer is not a valid object!
-                       throw new LogicException(sprintf('this->fileObject[]=%s is no object', gettype($this->getFileObject())));
+                       throw new LogicException(sprintf('this->fileObject[]=%s is no object', gettype($this->getFileObject())), FrameworkInterface::EXCEPTION_LOGIC_EXCEPTION);
                }
 
                // Write data to the file pointer and return written bytes
index b90b6721ddd8432b68ebdc4412833565070ecb25..f8762d9aa25825f3b8e2e480bbbe0aacef24870d 100644 (file)
@@ -171,7 +171,7 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry {
                                        continue;
                                } elseif (!($entry instanceof Registerable)) {
                                        // Not registerable?!
-                                       throw new LogicException(sprintf('entry[]=%s does not implement Registerable.', gettype($entry)));
+                                       throw new LogicException(sprintf('entry[]=%s does not implement Registerable.', gettype($entry)), FrameworkInterface::EXCEPTION_LOGIC_EXCEPTION);
                                }
 
                                // Is the current key set?
index 5aa5510598833206bbf315f984090c4617dfabec..6d8ac999019bb2f32f958d8fe5086f360b244b37 100644 (file)
@@ -86,7 +86,7 @@ final class CryptoUtils extends BaseFrameworkSystem {
                        throw new InvalidArgumentException('Parameter "str" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (!extension_loaded('hash')) {
                        // Should be there
-                       throw new LogicException('Extension ext-hash not loaded');
+                       throw new LogicException('Extension ext-hash not loaded', FrameworkInterface::EXCEPTION_LOGIC_EXCEPTION);
                }
 
                // Invoke static initializer
index 70e15b0ed9ed04592b2071e45e3a95893953caaf..b0fb3d1c065770deb120fcfbab9beff97b8776d9 100644 (file)
@@ -29,6 +29,7 @@ namespace Org\Mxchange\CoreFramework\Generic;
 interface FrameworkInterface {
        // Exception constants
        const EXCEPTION_INVALID_ARGUMENT = 0x200;
+       const EXCEPTION_LOGIC_EXCEPTION  = 0x201;
 
        /**
         * Getter for field name