N°4517 - PHP 8.1: Fix false to array conversion which is longer allowed

This commit is contained in:
Molkobain
2022-07-28 11:22:26 +02:00
parent 7e15c0874d
commit af36177b03

View File

@@ -812,10 +812,14 @@ class RunTimeEnvironment
// Database is created, installation has been tracked into it
return true;
}
/**
* @param \Config $oConfig
*
* @return array|false
*/
public function GetApplicationVersion(Config $oConfig)
{
$aResult = false;
try
{
CMDBSource::InitFromConfig($oConfig);
@@ -829,7 +833,8 @@ class RunTimeEnvironment
$this->log_error('Exception '.$e->getMessage());
return false;
}
$aResult = [];
// Scan the list of installed modules to get the version of the 'ROOT' module which holds the main application version
foreach ($aSelectInstall as $aInstall)
{
@@ -867,7 +872,7 @@ class RunTimeEnvironment
$aResult['datamodel_version'] = $aResult['product_version'];
}
$this->log_info("GetApplicationVersion returns: product_name: ".$aResult['product_name'].', product_version: '.$aResult['product_version']);
return $aResult;
return empty($aResult) ? false : $aResult;
}
public static function MakeDirSafe($sDir)