]> git.mxchange.org Git - core.git/blobdiff - framework/config/class_FrameworkConfiguration.php
Continued:
[core.git] / framework / config / class_FrameworkConfiguration.php
index b9c549aa60e1bfd52adaafa0479dd5d7eeaad661..98dd71b987dd6f63aa6d3cbed369b80da4332fb8 100644 (file)
@@ -7,7 +7,6 @@ namespace Org\Mxchange\CoreFramework\Configuration;
 use Org\Mxchange\CoreFramework\Configuration\NoConfigEntryException;
 use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
-use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
 use Org\Mxchange\CoreFramework\Utils\Strings\StringUtils;
 
@@ -24,7 +23,7 @@ use \UnexpectedValueException;
  * @see                        ClassLoader
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            1.0.1
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -118,7 +117,7 @@ class FrameworkConfiguration implements Registerable {
                }
 
                // Convert dashes to underscore
-               $configKey = StringUtils::convertDashesToUnderscores($configKey);
+               $configKey = str_replace('-', '_', $configKey);
 
                // Is a valid configuration key provided?
                //* NOISY-DEBUG: */ printf('[%s:%d]: configKey=%s - AFTER!' . PHP_EOL, __METHOD__, __LINE__, $configKey);
@@ -153,7 +152,7 @@ class FrameworkConfiguration implements Registerable {
                }
 
                // Cast to string
-               $configKey = StringUtils::convertDashesToUnderscores($configKey);
+               $configKey = str_replace('-', '_', $configKey);
 
                // Set the configuration value
                //* NOISY-DEBUG: */ printf('[%s:%d]: Setting configKey=%s,configValue[%s]=%s - EXIT!' . PHP_EOL, __METHOD__, __LINE__, $configKey, gettype($configValue), $configValue);
@@ -205,7 +204,7 @@ class FrameworkConfiguration implements Registerable {
                }
 
                // Convert dashes to underscore
-               $configKey = StringUtils::convertDashesToUnderscores($configKey);
+               $configKey = str_replace('-', '_', $configKey);
 
                // Is the configuration key there?
                //* NOISY-DEBUG: */ printf('[%s:%d]: configKey=%s - AFTER!' . PHP_EOL, __METHOD__, __LINE__, $configKey);
@@ -249,7 +248,7 @@ class FrameworkConfiguration implements Registerable {
                //* NOISY-DEBUG: */ printf('[%s:%d]: isEnabled[]=%s' . PHP_EOL, __METHOD__, __LINE__, gettype($isEnabled));
                if (!is_bool($isEnabled)) {
                        // Throw exception
-                       throw new UnexpectedValueException(sprintf('isEnabled[]=%s is unexpected', gettype($isEnabled)));
+                       throw new UnexpectedValueException(sprintf('isEnabled[]=%s is unexpected', gettype($isEnabled)), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
                }
 
                // Return it
@@ -304,7 +303,7 @@ class FrameworkConfiguration implements Registerable {
         */
        public final function getField (string $fieldName) {
                // The super interface "FrameworkInterface" requires this
-               throw new UnsupportedOperationException([$this, __FUNCTION__], BaseFrameworkSystem::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -316,7 +315,7 @@ class FrameworkConfiguration implements Registerable {
         */
        public function isFieldSet (string $fieldName) {
                // The super interface "FrameworkInterface" requires this
-               throw new UnsupportedOperationException([$this, __FUNCTION__], BaseFrameworkSystem::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
 }