]> git.mxchange.org Git - core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Tue, 28 Feb 2023 14:05:11 +0000 (15:05 +0100)
committerRoland Häder <roland@mxchange.org>
Tue, 28 Feb 2023 14:05:11 +0000 (15:05 +0100)
- added EXCEPTION_INVALID_ARGUMENT

framework/main/classes/criteria/search/class_SearchCriteria.php
framework/main/classes/registry/generic/class_GenericRegistry.php
framework/main/classes/registry/object/class_ObjectRegistry.php
framework/main/classes/utils/numbers/class_NumberUtils.php
framework/main/classes/utils/strings/class_StringUtils.php

index 1880919c8be9ffac85f1cd769883fc4f25f97e6e..7234fb23166c6e9bd86d669c98affac39eebd4e2 100644 (file)
@@ -100,7 +100,7 @@ class SearchCriteria extends BaseCriteria implements LocalSearchCriteria {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('SEARCH-CRITERIA: configKey=%s - CALLED!', $configKey));
                if (empty($configKey)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "configKey" is empty');
+                       throw new InvalidArgumentException('Parameter "configKey" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Get the limit from config entry
index a95f38ced18d1056355c82d71552e66147334845..f5ce8237c4882baaedd9248257f02d551b2382c1 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Mxchange\CoreFramework\Registry;
 
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
+
 /**
  * A registry for several data types and objects. Objects should be added by
  * addInstance() and therefore must implement the interface Registerable.
@@ -54,7 +57,7 @@ class GenericRegistry extends BaseRegistry implements Register {
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('OBJECT-REGISTRY: key=%s - CALLED!', $key));
                if (empty($key)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "key" is empty');
+                       throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Is an instance there?
index 102a26e2524065017e8cb62b7e3332eb8cd454de..8d25922f78dee05f698c812e052382313ce9ada5 100644 (file)
@@ -3,6 +3,7 @@
 namespace Org\Mxchange\CoreFramework\Registry\Object;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\NullPointerException;
 use Org\Mxchange\CoreFramework\Registry\BaseRegistry;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
@@ -70,7 +71,7 @@ class ObjectRegistry extends BaseRegistry implements ObjectRegister {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('OBJECT-REGISTRY: key=%s - CALLED!', $key));
                if (empty($key)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "key" is empty');
+                       throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Is an instance there?
index 264b17eecfdeb9a06d9ea7889172dcbc096ac285..aafd71d60021b139cba508934fd2ddb8067ee249 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Mxchange\CoreFramework\Utils\Numbers;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 
 // Import SPL stuff
@@ -87,7 +88,7 @@ final class NumberUtils extends BaseFrameworkSystem {
                //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NUMBER-UTILS: timestamp[%s]=%s - CALLED!', gettype($timestamp), $timestamp));
                if (empty($timestamp)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "timestamp" is empty');
+                       throw new InvalidArgumentException('Parameter "timestamp" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Default value to return
@@ -141,7 +142,7 @@ final class NumberUtils extends BaseFrameworkSystem {
                //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NUMBER-UTILS: num=%s,castValue=%d,assertMismatch=%d - CALLED!', $num, intval($castValue), intval($assertMismatch)));
                if ($num === '') {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "num" is empty');
+                       throw new InvalidArgumentException('Parameter "num" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Filter all numbers out
index c97c9fe3d23c0c3247fa8fb7b3e691bbedeef494..972035c12e0b827bc14a177fdc97b2166d078d56 100644 (file)
@@ -274,7 +274,7 @@ final class StringUtils extends BaseFrameworkSystem {
                //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STRING-UTILS: hex=%s - CALLED!', $hex));
                if (empty($hex)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "hex" is empty');
+                       throw new InvalidArgumentException('Parameter "hex" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Convert to all lower-case
@@ -366,7 +366,7 @@ final class StringUtils extends BaseFrameworkSystem {
                //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STRING-UTILS: asc=%s - CALLED!', $asc));
                if (empty($asc)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "asc" is empty');
+                       throw new InvalidArgumentException('Parameter "asc" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Convert it into a hexadecimal number
@@ -421,7 +421,7 @@ final class StringUtils extends BaseFrameworkSystem {
                /* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STRING-UTILS: hex=%s - CALLED!', $hex));
                if (empty($hex)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "hex" is empty');
+                       throw new InvalidArgumentException('Parameter "hex" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif ((strlen($hex) % 2) != 0) {
                        // Throw it again
                        throw new InvalidArgumentException(sprintf('hex=%s length not dividable by 2', $hex));
@@ -456,7 +456,7 @@ final class StringUtils extends BaseFrameworkSystem {
                //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STRING-UTILS: str=%s - CALLED!', $str));
                if (empty($str)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "str" is empty');
+                       throw new InvalidArgumentException('Parameter "str" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // First compress the string (gzcompress is okay)
@@ -512,7 +512,7 @@ final class StringUtils extends BaseFrameworkSystem {
                //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STRING-UTILS: num=%s,assertMismatch=%d - CALLED!', $num, intval($assertMismatch)));
                if (empty($num)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "num" is empty');
+                       throw new InvalidArgumentException('Parameter "num" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Filter all numbers out