Refactored physical interfaces in TDFs and TDF scripts
This commit is contained in:
@@ -189,10 +189,7 @@ class FromXmlService
|
||||
public function physicalInterfaceFromElement(DOMElement $element): PhysicalInterface
|
||||
{
|
||||
$attributes = $this->getNodeAttributesByName($element);
|
||||
return new PhysicalInterface(
|
||||
$attributes['name'] ?? null,
|
||||
$attributes['type'] ?? null,
|
||||
);
|
||||
return new PhysicalInterface($attributes['value'] ?? null);
|
||||
}
|
||||
|
||||
public function moduleFromElement(DOMElement $element): Module
|
||||
|
||||
@@ -125,8 +125,7 @@ class ToXmlService
|
||||
public function physicalInterfaceToXml(PhysicalInterface $physicalInterface, DOMDocument $document): DOMElement
|
||||
{
|
||||
$element = $document->createElement('physical-interface');
|
||||
$element->setAttribute('name', $physicalInterface->name);
|
||||
$element->setAttribute('type', $physicalInterface->type);
|
||||
$element->setAttribute('value', $physicalInterface->value);
|
||||
|
||||
return $element;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user