Skip to content

Commit 1481c44

Browse files
committed
Migrate DOM-classes to PHP 8.4's new DOM-API
1 parent 169bb5d commit 1481c44

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

tests/SAML2/CustomBaseID.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace SimpleSAML\Test\SAML2;
66

7-
use DOMElement;
7+
use Dom;
88
use SimpleSAML\SAML2\Assert\Assert;
99
use SimpleSAML\SAML2\Type\SAMLStringValue;
1010
use SimpleSAML\SAML2\XML\saml\AbstractBaseID;
@@ -67,7 +67,7 @@ public function getAudience(): array
6767
/**
6868
* @inheritDoc
6969
*/
70-
public static function fromXML(DOMElement $xml): static
70+
public static function fromXML(Dom\Element $xml): static
7171
{
7272
Assert::same($xml->localName, 'BaseID', InvalidDOMElementException::class);
7373
Assert::notNull($xml->namespaceURI, InvalidDOMElementException::class);
@@ -92,7 +92,7 @@ public static function fromXML(DOMElement $xml): static
9292
/**
9393
* Convert this BaseID to XML.
9494
*/
95-
public function toXML(?DOMElement $parent = null): DOMElement
95+
public function toXML(?Dom\Element $parent = null): Dom\Element
9696
{
9797
$e = parent::toXML($parent);
9898

tests/SAML2/CustomCondition.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace SimpleSAML\Test\SAML2;
66

7-
use DOMElement;
7+
use Dom;
88
use SimpleSAML\SAML2\Assert\Assert;
99
use SimpleSAML\SAML2\XML\saml\AbstractCondition;
1010
use SimpleSAML\SAML2\XML\saml\Audience;
@@ -62,7 +62,7 @@ public function getAudience(): array
6262
* @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException
6363
* if the qualified name of the supplied element is wrong
6464
*/
65-
public static function fromXML(DOMElement $xml): static
65+
public static function fromXML(Dom\Element $xml): static
6666
{
6767
Assert::same($xml->localName, 'Condition', InvalidDOMElementException::class);
6868
Assert::notNull($xml->namespaceURI, InvalidDOMElementException::class);
@@ -85,7 +85,7 @@ public static function fromXML(DOMElement $xml): static
8585
/**
8686
* Convert this Condition to XML.
8787
*/
88-
public function toXML(?DOMElement $parent = null): DOMElement
88+
public function toXML(?Dom\Element $parent = null): Dom\Element
8989
{
9090
$e = parent::toXML($parent);
9191

tests/SAML2/CustomRoleDescriptor.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace SimpleSAML\Test\SAML2;
66

7-
use DOMElement;
7+
use Dom;
88
use SimpleSAML\SAML2\Assert\Assert;
99
use SimpleSAML\SAML2\Type\SAMLAnyURIListValue;
1010
use SimpleSAML\SAML2\Type\SAMLAnyURIValue;
@@ -120,7 +120,7 @@ public function getChunk(): array
120120
* @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException
121121
* if the qualified name of the supplied element is wrong
122122
*/
123-
public static function fromXML(DOMElement $xml): static
123+
public static function fromXML(Dom\Element $xml): static
124124
{
125125
Assert::same($xml->localName, 'RoleDescriptor', InvalidDOMElementException::class);
126126
Assert::notNull($xml->namespaceURI, InvalidDOMElementException::class);
@@ -169,7 +169,7 @@ public static function fromXML(DOMElement $xml): static
169169
/**
170170
* Convert this RoleDescriptor to XML.
171171
*/
172-
public function toUnsignedXML(?DOMElement $parent = null): DOMElement
172+
public function toUnsignedXML(?Dom\Element $parent = null): Dom\Element
173173
{
174174
$e = parent::toUnsignedXML($parent);
175175

tests/SAML2/CustomStatement.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace SimpleSAML\Test\SAML2;
66

7-
use DOMElement;
7+
use Dom;
88
use SimpleSAML\SAML2\Assert\Assert;
99
use SimpleSAML\SAML2\XML\saml\AbstractStatement;
1010
use SimpleSAML\SAML2\XML\saml\Audience;
@@ -62,7 +62,7 @@ public function getAudience(): array
6262
* @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException
6363
* if the qualified name of the supplied element is wrong
6464
*/
65-
public static function fromXML(DOMElement $xml): static
65+
public static function fromXML(Dom\Element $xml): static
6666
{
6767
Assert::same($xml->localName, 'Statement', InvalidDOMElementException::class);
6868
Assert::notNull($xml->namespaceURI, InvalidDOMElementException::class);
@@ -85,7 +85,7 @@ public static function fromXML(DOMElement $xml): static
8585
/**
8686
* Convert this Statement to XML.
8787
*/
88-
public function toXML(?DOMElement $parent = null): DOMElement
88+
public function toXML(?Dom\Element $parent = null): Dom\Element
8989
{
9090
$e = parent::toXML($parent);
9191

0 commit comments

Comments
 (0)