setup: phpstan level 1

This commit is contained in:
odain
2026-01-13 16:11:34 +01:00
parent 8d2e0761e0
commit 13c18b611c
7 changed files with 28 additions and 28 deletions

View File

@@ -347,6 +347,7 @@ class RunTimeEnvironment
//
$oFactory = new ModelFactory($sSourceDirFull);
$aModulesToCompile = $this->GetMFModulesToCompile($sSourceEnv, $sSourceDir);
$oModule = null;
foreach ($aModulesToCompile as $oModule) {
if ($oModule instanceof MFDeltaModule) {
// Just before loading the delta, let's save an image of the datamodel
@@ -356,7 +357,7 @@ class RunTimeEnvironment
$oFactory->LoadModule($oModule);
}
if ($oModule instanceof MFDeltaModule) {
if (!is_null($oModule) && ($oModule instanceof MFDeltaModule)) {
// A delta was loaded, let's save a second copy of the datamodel
$oFactory->SaveToFile(utils::GetDataPath().'datamodel-'.$this->sTargetEnv.'-with-delta.xml');
} else {
@@ -667,7 +668,8 @@ class RunTimeEnvironment
$aResult['datamodel_version'] = $aResult['product_version'];
}
$this->log_info("GetApplicationVersion returns: product_name: ".$aResult['product_name'].', product_version: '.$aResult['product_version']);
return empty($aResult) ? false : $aResult;
return count($aResult) == 0 ? false : $aResult;
}
public static function MakeDirSafe($sDir)
@@ -963,7 +965,7 @@ class RunTimeEnvironment
foreach ($aPreviouslyLoadedFiles as $sFileRelativePath) {
$sFileName = APPROOT.$sFileRelativePath;
SetupLog::Info("Loading file: $sFileName (just to get the keys mapping)");
if (empty($sFileName) || !file_exists($sFileName)) {
if (!file_exists($sFileName)) {
throw(new Exception("File $sFileName does not exist"));
}
@@ -975,7 +977,7 @@ class RunTimeEnvironment
foreach ($aFiles as $sFileRelativePath) {
$sFileName = APPROOT.$sFileRelativePath;
SetupLog::Info("Loading file: $sFileName");
if (empty($sFileName) || !file_exists($sFileName)) {
if (!file_exists($sFileName)) {
throw(new Exception("File $sFileName does not exist"));
}