Minor code improvements:
[shipsimu.git] / inc / classes / main / class_BaseFrameworkSystem.php
index 4a6eb893e0418d524b38ba71681d6e859dc27db6..96338267adb4d54441d2007c7bff657c441b6610 100644 (file)
@@ -480,11 +480,16 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @return      $dbInstance     The database layer instance
         */
        public final function getDatabaseInstance () {
+               // Default is invalid db instance
+               $dbInstance = null;
+
+               // Is the registry there and initialized?
                if ((class_exists('Registry')) && (Registry::isInitialized() === true)) {
-                       return Registry::getRegistry()->getInstance('dbInstance');
-               } else {
-                       return null;
-               }
+                       $dbInstance = Registry::getRegistry()->getInstance('dbInstance');
+               } // END - if
+
+               // Return instance
+               return $dbInstance;
        }
 
        /**
@@ -721,11 +726,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @return      $objectDescription      The description of this simulation part
         */
        public final function getObjectDescription () {
-               if (isset($this->objectDescription)) {
-                       return $this->objectDescription;
-               } else {
-                       return null;
-               }
+               return $this->objectDescription;
        }
 
        /**
@@ -750,7 +751,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
 
        /**
         * Compare if both simulation part description and class name matches
-        * (shall be enougth)
+        * (shall be enough)
         *
         * @param       $itemInstance   An object instance to an other class
         * @return      boolean                 The result of comparing class name simulation part description