setup: phpstan level 2

setup: phpstan level 2
This commit is contained in:
odain
2026-01-13 16:29:16 +01:00
parent 13c18b611c
commit 0582ae1038
9 changed files with 30 additions and 23 deletions

View File

@@ -230,6 +230,7 @@ class XMLDataLoader
} else {
$iDstObj = (int)($oSubNode);
// Attempt to find the object in the list of loaded objects
/** @var \Combodo\iTop\Core\AttributeDefinition\AttributeExternalKey $oAttDef */
$iExtKey = $this->GetObjectKey($oAttDef->GetTargetClass(), $iDstObj);
if ($iExtKey == 0) {
$iExtKey = -$iDstObj; // Convention: Unresolved keys are stored as negative !
@@ -356,6 +357,7 @@ class XMLDataLoader
$iExtKey = -1;
foreach (MetaModel::ListAttributeDefs($sClass) as $sAttCode => $oAttDef) {
if (($oAttDef->IsExternalKey()) && ($oTargetObj->Get($sAttCode) < 0)) { // Convention unresolved key = negative
/** @var \Combodo\iTop\Core\AttributeDefinition\AttributeExternalKey $oAttDef */
$sTargetClass = $oAttDef->GetTargetClass();
$iTempKey = $oTargetObj->Get($sAttCode);