X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=inc%2Fconfig%2Fclass_FrameworkConfiguration.php;h=c63775517ff9f65608d30123b7f2b59cf34cd8f3;hp=d6ff28a24da1226428e14824e42cf8e6ccfb462d;hb=fe28fd87dd0c4e129cef6ee7bd4e257a3f3ba280;hpb=1c4fc1ae50d2e99f9e52a2fe86c15caeab55de70 diff --git a/inc/config/class_FrameworkConfiguration.php b/inc/config/class_FrameworkConfiguration.php index d6ff28a2..c6377551 100644 --- a/inc/config/class_FrameworkConfiguration.php +++ b/inc/config/class_FrameworkConfiguration.php @@ -2,13 +2,13 @@ /** * A class for the configuration stuff implemented in a singleton design paddern * - * NOTE: We cannot put this in inc/classes/ because it would be loaded (again) in + * NOTE: We cannot put this in inc/main/ because it would be loaded (again) in * class loader. See inc/loader/class_ClassLoader.php for instance * * @see ClassLoader * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Core Developer Team + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team * @license GNU GPL 3.0 or any newer version * @link http://www.shipsimu.org * @@ -153,7 +153,7 @@ class FrameworkConfiguration implements Registerable { */ public function getConfigEntry ($configKey) { // Convert dashes to underscore - $configKey = $this->convertDashesToUnderscores($configKey); + $configKey = self::convertDashesToUnderscores($configKey); // Is a valid configuration key provided? if (empty($configKey)) { @@ -179,10 +179,13 @@ class FrameworkConfiguration implements Registerable { */ public final function setConfigEntry ($configKey, $configValue) { // Cast to string - $configKey = $this->convertDashesToUnderscores($configKey); + $configKey = self::convertDashesToUnderscores($configKey); // Is a valid configuration key key provided? - if ((empty($configKey)) || (!is_string($configKey))) { + if (is_null($configKey)) { + // Configuration key is null + throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER); + } elseif ((empty($configKey)) || (!is_string($configKey))) { // Entry is empty throw new ConfigEntryIsEmptyException($this, self::EXCEPTION_CONFIG_KEY_IS_EMPTY); } elseif ((is_null($configValue)) || (is_array($configValue)) || (is_object($configValue)) || (is_resource($configValue))) { @@ -208,7 +211,7 @@ class FrameworkConfiguration implements Registerable { */ public final function unsetConfigEntry ($configKey) { // Convert dashes to underscore - $configKey = $this->convertDashesToUnderscores($configKey); + $configKey = self::convertDashesToUnderscores($configKey); // Is the configuration key there? if (!$this->isConfigurationEntrySet($configKey)) { @@ -363,6 +366,7 @@ class FrameworkConfiguration implements Registerable { */ public final function getField ($fieldName) { // Our super interface "FrameworkInterface" requires this + throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION); } /** @@ -374,6 +378,7 @@ class FrameworkConfiguration implements Registerable { */ public function isFieldSet ($fieldName) { // Our super interface "FrameworkInterface" requires this + throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION); } /**