Skip to content

Commit

Permalink
Remove unnecessary toXML/fromXML
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Dec 26, 2023
1 parent c495092 commit 193f7e1
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 36 deletions.
33 changes: 0 additions & 33 deletions src/Base64ElementTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,39 +53,6 @@ protected function validateContent(string $content): void
}


/**
* Convert XML into a class instance
*
* @param \DOMElement $xml The XML element we should load
* @return static
*
* @throws \SimpleSAML\XML\Exception\InvalidDOMElementException
* If the qualified name of the supplied element is wrong
*/
public static function fromXML(DOMElement $xml): static
{
Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class);
Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class);

return new static($xml->textContent);
}


/**
* Convert this element to XML.
*
* @param \DOMElement|null $parent The element we should append this element to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);
$e->textContent = $this->getContent();

return $e;
}


/** @return string */
abstract public static function getLocalName(): string;

Expand Down
1 change: 0 additions & 1 deletion tests/XML/AbstractElementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public function testMarshalling(): void

/**
*/
#[Override]
public function testUnmarshalling(): void
{
$element = Element::fromXML(self::$xmlRepresentation->documentElement);
Expand Down
1 change: 0 additions & 1 deletion tests/XML/Base64ElementTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public function testMarshalling(): void

/**
*/
#[Override]
public function testUnmarshalling(): void
{
$base64Element = Base64Element::fromXML(self::$xmlRepresentation->documentElement);
Expand Down
1 change: 0 additions & 1 deletion tests/XML/ChunkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ public function testMarshalling(): void

/**
*/
#[Override]
public function testUnmarshalling(): void
{
$element = Chunk::fromXML(self::$xmlRepresentation->documentElement);
Expand Down

0 comments on commit 193f7e1

Please sign in to comment.