Skip to content

Commit

Permalink
Fix: Name and Namespace are required by schema
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Mar 17, 2024
1 parent 3c9a55d commit e90e44a
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/SAML11/XML/saml/AbstractAttributeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ public static function fromXML(DOMElement $xml): static
Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class);

$attributeValue = AttributeValue::getChildrenOfClass($xml);
$AttributeName = self::getOptionalAttribute($xml, 'AttributeName');
$AttributeNamespace = self::getOptionalAttribute($xml, 'AttributeNamespace');
$AttributeName = self::getAttribute($xml, 'AttributeName');
$AttributeNamespace = self::getAttribute($xml, 'AttributeNamespace');

return new static($AttributeName, $AttributeNamespace, $attributeValue);
}
Expand All @@ -79,14 +79,8 @@ public static function fromXML(DOMElement $xml): static
public function toXML(DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);

if ($this->getAttributeName() !== null) {
$e->setAttribute('AttributeName', $this->getAttributeName());
}

if ($this->getAttributeNamespace() !== null) {
$e->setAttribute('AttributeNamespace', $this->getAttributeNamespace());
}
$e->setAttribute('AttributeName', $this->getAttributeName());
$e->setAttribute('AttributeNamespace', $this->getAttributeNamespace());

foreach ($this->getAttributeValue() as $av) {
$av->toXML($e);
Expand Down

0 comments on commit e90e44a

Please sign in to comment.