X-Git-Url: https://git.mxchange.org/?p=shipsimu.git;a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Fclass_BaseFrameworkSystem.php;h=96338267adb4d54441d2007c7bff657c441b6610;hp=4a6eb893e0418d524b38ba71681d6e859dc27db6;hb=db61178ebaf96aa11cc16f18af4fedaaf32fe2de;hpb=428f13602500ee8408161c0126456f8bfe229472 diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index 4a6eb89..9633826 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -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