]> git.mxchange.org Git - core.git/blobdiff - framework/config/class_FrameworkConfiguration.php
Continued a bit:
[core.git] / framework / config / class_FrameworkConfiguration.php
index 16ebaf86dcd0d90eebdc46d98125e64468e20bb8..9f158c362518c8dac127aebf275c599ed6cb6804 100644 (file)
@@ -112,7 +112,10 @@ class FrameworkConfiguration implements Registerable {
                if (is_null($str)) {
                        // Throw NPE
                        throw new NullPointerException($this, BaseFrameworkSystem::EXCEPTION_IS_NULL_POINTER);
-               } elseif (empty($str)) {
+               } elseif (!is_string($str)) {
+                       // Entry is empty
+                       throw new InvalidArgumentException(sprintf('str[]=%s is not a string', gettype($str)), self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
+               } elseif ((is_string($str)) && (empty($str))) {
                        // Entry is empty
                        throw new InvalidArgumentException('str is empty', self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
                }
@@ -140,7 +143,7 @@ class FrameworkConfiguration implements Registerable {
                } elseif (!is_string($timezone)) {
                        // Is not a string
                        throw new InvalidArgumentException(sprintf('timezone[]=%s is not a string', gettype($timezone)), self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
-               } elseif (empty($timezone)) {
+               } elseif ((is_string($timezone)) && (empty($timezone))) {
                        // Entry is empty
                        throw new InvalidArgumentException('timezone is empty', self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
                }
@@ -174,7 +177,7 @@ class FrameworkConfiguration implements Registerable {
                } elseif (!is_string($configKey)) {
                        // Is not a string
                        throw new InvalidArgumentException(sprintf('configKey[]=%s is not a string', gettype($configKey)), self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
-               } elseif (empty($configKey)) {
+               } elseif ((is_string($configKey)) && (empty($configKey))) {
                        // Entry is empty
                        throw new InvalidArgumentException('configKey is empty', self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
                }
@@ -203,7 +206,7 @@ class FrameworkConfiguration implements Registerable {
                } elseif (!is_string($configKey)) {
                        // Is not a string
                        throw new InvalidArgumentException(sprintf('configKey[]=%s is not a string', gettype($configKey)), self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
-               } elseif (empty($configKey)) {
+               } elseif ((is_string($configKey)) && (empty($configKey))) {
                        // Entry is empty
                        throw new InvalidArgumentException('configKey is empty', self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
                }
@@ -239,7 +242,7 @@ class FrameworkConfiguration implements Registerable {
                } elseif (!is_string($configKey)) {
                        // Is not a string
                        throw new InvalidArgumentException(sprintf('configKey[]=%s is not a string', gettype($configKey)), self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
-               } elseif (empty($configKey)) {
+               } elseif ((is_string($configKey)) && (empty($configKey))) {
                        // Entry is empty
                        throw new InvalidArgumentException('configKey is empty', self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
                } elseif ((is_array($configValue)) || (is_object($configValue)) || (is_resource($configValue))) {
@@ -286,7 +289,7 @@ class FrameworkConfiguration implements Registerable {
                } elseif (!is_string($configKey)) {
                        // Entry is empty
                        throw new InvalidArgumentException(sprintf('configKey[]=%s is not a string', gettype($configKey)), self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
-               } elseif (empty($configKey)) {
+               } elseif ((is_string($configKey)) && (empty($configKey))) {
                        // Entry is empty
                        throw new InvalidArgumentException('configKey is empty', self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
                }
@@ -360,7 +363,7 @@ class FrameworkConfiguration implements Registerable {
                } elseif (!is_string($serverAddress)) {
                        // Is not a string
                        throw new InvalidArgumentException(sprintf('serverAddress[]=%s is not a string', gettype($serverAddress)), self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
-               } elseif (empty($serverAddress)) {
+               } elseif ((is_string($serverAddress)) && (empty($serverAddress))) {
                        // Entry is empty
                        throw new InvalidArgumentException('serverAddress is empty', self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
                }