N°8772 - Compiler: Add errors check

This commit is contained in:
Eric Espie
2025-12-11 12:16:14 +01:00
parent 94fed54529
commit 41d15f1b33
9 changed files with 202 additions and 31 deletions

View File

@@ -38,14 +38,14 @@ class PropertyTreeFactory
* @throws \Combodo\iTop\PropertyTree\PropertyTreeException
* @throws \DOMFormatException
*/
public function CreateNodeFromDom(DesignElement $oDomNode, string $sParentId = ''): AbstractProperty
public function CreateNodeFromDom(DesignElement $oDomNode, ?AbstractProperty $oParent = null): AbstractProperty
{
$sNodeType = $oDomNode->getAttribute('xsi:type');
// The class of the property tree node is given by the xsi:type attribute
if (is_a($sNodeType, AbstractProperty::class, true)) {
$oNode = new $sNodeType();
$oNode->InitFromDomNode($oDomNode, $sParentId);
$oNode->InitFromDomNode($oDomNode, $oParent);
return $oNode;
}