]> git.mxchange.org Git - core.git/blobdiff - inc/config/class_FrameworkConfiguration.php
Continued:
[core.git] / inc / config / class_FrameworkConfiguration.php
index 5a206d5c5572af41f1aea0bf9808925eab837ff5..ebe8e4456ca8a5b410936f079b864b7f35df7b37 100644 (file)
@@ -1,14 +1,21 @@
 <?php
+// Own namespace
+namespace CoreFramework\Configuration;
+
+// Import framework stuff
+use CoreFramework\Generic\FrameworkInterface;
+use CoreFramework\Registry\Registerable;
+
 /**
  * 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 <webmaster@shipsimu.org>
  * @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
  *
@@ -182,7 +189,10 @@ class FrameworkConfiguration implements Registerable {
                $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))) {
@@ -363,6 +373,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 +385,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);
        }
 
        /**
@@ -403,7 +415,5 @@ class FrameworkConfiguration implements Registerable {
                // Return the result
                return $equals;
        }
-}
 
-// [EOF]
-?>
+}