From 337dc990fd597530fe345d298b4f2ca2484064c3 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Fri, 29 May 2026 23:55:33 +0200 Subject: [PATCH 1/3] Migrate DOM-classes to PHP 8.4's new DOM-API --- .github/workflows/php.yml | 14 ++++++++------ composer.json | 4 ++-- src/XML/soap12/AbstractAddress.php | 12 ++++++------ src/XML/soap12/AbstractBinding.php | 12 ++++++------ src/XML/soap12/AbstractBody.php | 8 ++++---- src/XML/soap12/AbstractFault.php | 12 ++++++------ src/XML/soap12/AbstractHeader.php | 12 ++++++------ src/XML/soap12/AbstractHeaderFault.php | 12 ++++++------ src/XML/soap12/AbstractOperation.php | 12 ++++++------ src/XML/soap12/Body.php | 6 +++--- src/XML/wsdl/AbstractBinding.php | 8 ++++---- src/XML/wsdl/AbstractBindingOperation.php | 8 ++++---- src/XML/wsdl/AbstractBindingOperationFault.php | 8 ++++---- src/XML/wsdl/AbstractBindingOperationMessage.php | 8 ++++---- src/XML/wsdl/AbstractDefinitions.php | 8 ++++---- src/XML/wsdl/AbstractDocumented.php | 8 ++++---- src/XML/wsdl/AbstractExtensibilityElement.php | 8 ++++---- .../AbstractExtensibleAttributesDocumented.php | 8 ++++---- src/XML/wsdl/AbstractExtensibleDocumented.php | 8 ++++---- src/XML/wsdl/AbstractFault.php | 8 ++++---- src/XML/wsdl/AbstractImport.php | 8 ++++---- src/XML/wsdl/AbstractMessage.php | 8 ++++---- src/XML/wsdl/AbstractParam.php | 8 ++++---- src/XML/wsdl/AbstractPart.php | 8 ++++---- src/XML/wsdl/AbstractPort.php | 8 ++++---- src/XML/wsdl/AbstractPortType.php | 8 ++++---- src/XML/wsdl/AbstractPortTypeOperation.php | 8 ++++---- src/XML/wsdl/AbstractService.php | 8 ++++---- src/XML/wsdl/Binding.php | 6 +++--- src/XML/wsdl/BindingOperation.php | 6 +++--- src/XML/wsdl/BindingOperationFault.php | 6 +++--- src/XML/wsdl/BindingOperationInput.php | 6 +++--- src/XML/wsdl/BindingOperationOutput.php | 6 +++--- src/XML/wsdl/Definitions.php | 6 +++--- src/XML/wsdl/Fault.php | 6 +++--- src/XML/wsdl/Import.php | 6 +++--- src/XML/wsdl/Input.php | 6 +++--- src/XML/wsdl/Message.php | 6 +++--- src/XML/wsdl/Output.php | 6 +++--- src/XML/wsdl/Part.php | 6 +++--- src/XML/wsdl/Port.php | 6 +++--- src/XML/wsdl/PortType.php | 6 +++--- src/XML/wsdl/PortTypeOperation.php | 8 ++++---- src/XML/wsdl/Service.php | 6 +++--- src/XML/wsdl/Types.php | 6 +++--- tests/WSDL/XML/soap12/AddressTest.php | 9 +++++---- tests/WSDL/XML/soap12/BindingTest.php | 9 +++++---- tests/WSDL/XML/soap12/BodyTest.php | 9 +++++---- tests/WSDL/XML/soap12/FaultTest.php | 9 +++++---- tests/WSDL/XML/soap12/HeaderFaultTest.php | 9 +++++---- tests/WSDL/XML/soap12/HeaderTest.php | 9 +++++---- tests/WSDL/XML/soap12/OperationTest.php | 9 +++++---- tests/WSDL/XML/wsdl/BindingOperationTest.php | 9 +++++---- tests/WSDL/XML/wsdl/BindingTest.php | 9 +++++---- tests/WSDL/XML/wsdl/DefinitionsTest.php | 9 +++++---- tests/WSDL/XML/wsdl/FaultTest.php | 9 +++++---- tests/WSDL/XML/wsdl/ImportTest.php | 9 +++++---- tests/WSDL/XML/wsdl/InputTest.php | 9 +++++---- tests/WSDL/XML/wsdl/MessageTest.php | 9 +++++---- tests/WSDL/XML/wsdl/OutputTest.php | 9 +++++---- tests/WSDL/XML/wsdl/PartTest.php | 9 +++++---- tests/WSDL/XML/wsdl/PortTest.php | 9 +++++---- tests/WSDL/XML/wsdl/PortTypeOperationInputTest.php | 9 +++++---- .../WSDL/XML/wsdl/PortTypeOperationOutputTest.php | 9 +++++---- tests/WSDL/XML/wsdl/PortTypeTest.php | 9 +++++---- tests/WSDL/XML/wsdl/ServiceTest.php | 11 ++++++----- tests/WSDL/XML/wsdl/TypesTest.php | 9 +++++---- 67 files changed, 288 insertions(+), 264 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 8523b0a..bfe41a5 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -19,9 +19,10 @@ jobs: strategy: fail-fast: false matrix: - php-version: ['8.3', '8.4', '8.5'] + php-version: ['8.5'] - uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.11.5 + uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1 + secrets: inherit with: php-version: ${{ matrix.php-version }} @@ -30,7 +31,8 @@ jobs: strategy: fail-fast: false - uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1.11.5 + uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1 + secrets: inherit with: enable_eslinter: false enable_jsonlinter: true @@ -45,7 +47,7 @@ jobs: fail-fast: false matrix: operating-system: [ubuntu-latest] - php-versions: ['8.3', '8.4', '8.5'] + php-versions: ['8.5'] steps: - name: Setup PHP, with composer and extensions @@ -107,7 +109,7 @@ jobs: fail-fast: true matrix: operating-system: [windows-latest] - php-versions: ['8.3', '8.4', '8.5'] + php-versions: ['8.5'] steps: - name: Setup PHP, with composer and extensions @@ -215,7 +217,7 @@ jobs: uses: shivammathur/setup-php@v2 with: # Should be the lowest supported version - php-version: '8.3' + php-version: '8.5' extensions: ctype, date, dom, filter, pcre, soap, spl, xml tools: composer coverage: none diff --git a/composer.json b/composer.json index 6616871..ed7b2c0 100644 --- a/composer.json +++ b/composer.json @@ -9,12 +9,12 @@ } ], "require": { - "php": "^8.3", + "php": "^8.5", "ext-dom": "*", "ext-spl": "*", "simplesamlphp/assert": "~2.0", - "simplesamlphp/xml-common": "~2.8" + "simplesamlphp/xml-common": "dev-feature/dom-migration-php84" }, "require-dev": { "simplesamlphp/simplesamlphp-test-framework": "~1.11" diff --git a/src/XML/soap12/AbstractAddress.php b/src/XML/soap12/AbstractAddress.php index 3bbd7cb..522a97b 100644 --- a/src/XML/soap12/AbstractAddress.php +++ b/src/XML/soap12/AbstractAddress.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\soap12; -use DOMElement; +use Dom; use SimpleSAML\Assert\Assert; use SimpleSAML\WSDL\Constants as C; use SimpleSAML\WSDL\Type\RequiredValue; @@ -56,12 +56,12 @@ public function getLocation(): AnyURIValue /** * Initialize a Address element. * - * @param \DOMElement $xml The XML element we should load. + * @param \Dom\Element $xml The XML element we should load. * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); @@ -81,10 +81,10 @@ public static function fromXML(DOMElement $xml): static /** * Convert this tBinding to XML. * - * @param \DOMElement|null $parent The element we are converting to XML. - * @return \DOMElement The XML element after adding the data corresponding to this tBinding + * @param \Dom\Element|null $parent The element we are converting to XML. + * @return \Dom\Element The XML element after adding the data corresponding to this tBinding */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = parent::toXML($parent); $e->setAttribute('location', $this->getLocation()->getValue()); diff --git a/src/XML/soap12/AbstractBinding.php b/src/XML/soap12/AbstractBinding.php index 28cb266..57dfe9c 100644 --- a/src/XML/soap12/AbstractBinding.php +++ b/src/XML/soap12/AbstractBinding.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\soap12; -use DOMElement; +use Dom; use SimpleSAML\Assert\Assert; use SimpleSAML\WSDL\Constants as C; use SimpleSAML\WSDL\Type\RequiredValue; @@ -81,12 +81,12 @@ public function isEmptyElement(): bool /** * Initialize a Binding element. * - * @param \DOMElement $xml The XML element we should load. + * @param \Dom\Element $xml The XML element we should load. * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); @@ -107,10 +107,10 @@ public static function fromXML(DOMElement $xml): static /** * Convert this tBinding to XML. * - * @param \DOMElement|null $parent The element we are converting to XML. - * @return \DOMElement The XML element after adding the data corresponding to this tBinding + * @param \Dom\Element|null $parent The element we are converting to XML. + * @return \Dom\Element The XML element after adding the data corresponding to this tBinding */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = parent::toXML($parent); diff --git a/src/XML/soap12/AbstractBody.php b/src/XML/soap12/AbstractBody.php index 737588f..d71525b 100644 --- a/src/XML/soap12/AbstractBody.php +++ b/src/XML/soap12/AbstractBody.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\soap12; -use DOMElement; +use Dom; use SimpleSAML\WSDL\Constants as C; use SimpleSAML\WSDL\Type\RequiredValue; use SimpleSAML\WSDL\Type\UseChoiceValue; @@ -83,10 +83,10 @@ public function isEmptyElement(): bool /** * Convert this tBody to XML. * - * @param \DOMElement|null $parent The element we are converting to XML. - * @return \DOMElement The XML element after adding the data corresponding to this tBody + * @param \Dom\Element|null $parent The element we are converting to XML. + * @return \Dom\Element The XML element after adding the data corresponding to this tBody */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = parent::toXML($parent); diff --git a/src/XML/soap12/AbstractFault.php b/src/XML/soap12/AbstractFault.php index b0581b5..39ed220 100644 --- a/src/XML/soap12/AbstractFault.php +++ b/src/XML/soap12/AbstractFault.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\soap12; -use DOMElement; +use Dom; use SimpleSAML\Assert\Assert; use SimpleSAML\WSDL\Constants as C; use SimpleSAML\WSDL\Type\RequiredValue; @@ -49,12 +49,12 @@ final public function __construct( /** * Initialize a Body element. * - * @param \DOMElement $xml The XML element we should load. + * @param \Dom\Element $xml The XML element we should load. * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); @@ -76,10 +76,10 @@ public static function fromXML(DOMElement $xml): static /** * Convert this tFault to XML. * - * @param \DOMElement|null $parent The element we are converting to XML. - * @return \DOMElement The XML element after adding the data corresponding to this tFault + * @param \Dom\Element|null $parent The element we are converting to XML. + * @return \Dom\Element The XML element after adding the data corresponding to this tFault */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { return parent::toXML($parent); } diff --git a/src/XML/soap12/AbstractHeader.php b/src/XML/soap12/AbstractHeader.php index 14c9d6e..25e0d25 100644 --- a/src/XML/soap12/AbstractHeader.php +++ b/src/XML/soap12/AbstractHeader.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\soap12; -use DOMElement; +use Dom; use SimpleSAML\Assert\Assert; use SimpleSAML\WSDL\Constants as C; use SimpleSAML\WSDL\Type\RequiredValue; @@ -102,12 +102,12 @@ public function getParts(): ?NMTokensValue /** * Initialize a Header element. * - * @param \DOMElement $xml The XML element we should load. + * @param \Dom\Element $xml The XML element we should load. * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); @@ -132,10 +132,10 @@ public static function fromXML(DOMElement $xml): static /** * Convert this tHeader to XML. * - * @param \DOMElement|null $parent The element we are converting to XML. - * @return \DOMElement The XML element after adding the data corresponding to this tHeader + * @param \Dom\Element|null $parent The element we are converting to XML. + * @return \Dom\Element The XML element after adding the data corresponding to this tHeader */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = parent::toXML($parent); diff --git a/src/XML/soap12/AbstractHeaderFault.php b/src/XML/soap12/AbstractHeaderFault.php index e35d593..b447406 100644 --- a/src/XML/soap12/AbstractHeaderFault.php +++ b/src/XML/soap12/AbstractHeaderFault.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\soap12; -use DOMElement; +use Dom; use SimpleSAML\WSDL\Assert\Assert; use SimpleSAML\WSDL\Type\UseChoiceValue; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; @@ -73,12 +73,12 @@ public function getParts(): ?NMTokensValue /** * Initialize a Header element. * - * @param \DOMElement $xml The XML element we should load. + * @param \Dom\Element $xml The XML element we should load. * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); @@ -96,10 +96,10 @@ public static function fromXML(DOMElement $xml): static /** * Convert this tHeader to XML. * - * @param \DOMElement|null $parent The element we are converting to XML. - * @return \DOMElement The XML element after adding the data corresponding to this tHeader + * @param \Dom\Element|null $parent The element we are converting to XML. + * @return \Dom\Element The XML element after adding the data corresponding to this tHeader */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = $this->instantiateParentElement($parent); diff --git a/src/XML/soap12/AbstractOperation.php b/src/XML/soap12/AbstractOperation.php index 539a7d4..1e07e80 100644 --- a/src/XML/soap12/AbstractOperation.php +++ b/src/XML/soap12/AbstractOperation.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\soap12; -use DOMElement; +use Dom; use SimpleSAML\Assert\Assert; use SimpleSAML\WSDL\Constants as C; use SimpleSAML\WSDL\Type\RequiredValue; @@ -96,12 +96,12 @@ public function isEmptyElement(): bool /** * Initialize an Operation element. * - * @param \DOMElement $xml The XML element we should load. + * @param \Dom\Element $xml The XML element we should load. * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); @@ -123,10 +123,10 @@ public static function fromXML(DOMElement $xml): static /** * Convert this tOperation to XML. * - * @param \DOMElement|null $parent The element we are converting to XML. - * @return \DOMElement The XML element after adding the data corresponding to this tOperation + * @param \Dom\Element|null $parent The element we are converting to XML. + * @return \Dom\Element The XML element after adding the data corresponding to this tOperation */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = parent::toXML($parent); diff --git a/src/XML/soap12/Body.php b/src/XML/soap12/Body.php index 01b5305..be506c0 100644 --- a/src/XML/soap12/Body.php +++ b/src/XML/soap12/Body.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\soap12; -use DOMElement; +use Dom; use SimpleSAML\Assert\Assert; use SimpleSAML\WSDL\Constants as C; use SimpleSAML\WSDL\Type\RequiredValue; @@ -28,12 +28,12 @@ final class Body extends AbstractBody implements SchemaValidatableElementInterfa /** * Initialize a Body element. * - * @param \DOMElement $xml The XML element we should load. + * @param \Dom\Element $xml The XML element we should load. * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); diff --git a/src/XML/wsdl/AbstractBinding.php b/src/XML/wsdl/AbstractBinding.php index 31479c4..e0d934a 100644 --- a/src/XML/wsdl/AbstractBinding.php +++ b/src/XML/wsdl/AbstractBinding.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\WSDL\Assert\Assert; use SimpleSAML\XMLSchema\Exception\SchemaViolationException; use SimpleSAML\XMLSchema\Type\NCNameValue; @@ -83,10 +83,10 @@ public function isEmptyElement(): bool /** * Convert this tBinding to XML. * - * @param \DOMElement|null $parent The element we are converting to XML. - * @return \DOMElement The XML element after adding the data corresponding to this tBinding. + * @param \Dom\Element|null $parent The element we are converting to XML. + * @return \Dom\Element The XML element after adding the data corresponding to this tBinding. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = parent::toXML($parent); diff --git a/src/XML/wsdl/AbstractBindingOperation.php b/src/XML/wsdl/AbstractBindingOperation.php index cbc529b..c098432 100644 --- a/src/XML/wsdl/AbstractBindingOperation.php +++ b/src/XML/wsdl/AbstractBindingOperation.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\WSDL\Assert\Assert; use SimpleSAML\XMLSchema\Exception\SchemaViolationException; use SimpleSAML\XMLSchema\Type\NCNameValue; @@ -95,10 +95,10 @@ public function isEmptyElement(): bool /** * Convert this tBindingOperation to XML. * - * @param \DOMElement|null $parent The element we are converting to XML. - * @return \DOMElement The XML element after adding the data corresponding to this tBindingOperation. + * @param \Dom\Element|null $parent The element we are converting to XML. + * @return \Dom\Element The XML element after adding the data corresponding to this tBindingOperation. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = parent::toXML($parent); diff --git a/src/XML/wsdl/AbstractBindingOperationFault.php b/src/XML/wsdl/AbstractBindingOperationFault.php index 83f3cec..b143b1a 100644 --- a/src/XML/wsdl/AbstractBindingOperationFault.php +++ b/src/XML/wsdl/AbstractBindingOperationFault.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\XMLSchema\Type\NCNameValue; /** @@ -52,10 +52,10 @@ public function isEmptyElement(): bool /** * Convert this tBindingOperationFault to XML. * - * @param \DOMElement|null $parent The element we are converting to XML. - * @return \DOMElement The XML element after adding the data corresponding to this tBindingOperationFault. + * @param \Dom\Element|null $parent The element we are converting to XML. + * @return \Dom\Element The XML element after adding the data corresponding to this tBindingOperationFault. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = parent::toXML($parent); $e->setAttribute('name', $this->getName()->getValue()); diff --git a/src/XML/wsdl/AbstractBindingOperationMessage.php b/src/XML/wsdl/AbstractBindingOperationMessage.php index 543962d..202a764 100644 --- a/src/XML/wsdl/AbstractBindingOperationMessage.php +++ b/src/XML/wsdl/AbstractBindingOperationMessage.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\XMLSchema\Type\NCNameValue; /** @@ -51,10 +51,10 @@ public function isEmptyElement(): bool /** * Convert this tBindingOperationMessage to XML. * - * @param \DOMElement|null $parent The element we are converting to XML. - * @return \DOMElement The XML element after adding the data corresponding to this tBindingOperationMessage. + * @param \Dom\Element|null $parent The element we are converting to XML. + * @return \Dom\Element The XML element after adding the data corresponding to this tBindingOperationMessage. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = parent::toXML($parent); diff --git a/src/XML/wsdl/AbstractDefinitions.php b/src/XML/wsdl/AbstractDefinitions.php index 1c12a92..82b2906 100644 --- a/src/XML/wsdl/AbstractDefinitions.php +++ b/src/XML/wsdl/AbstractDefinitions.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\WSDL\Assert\Assert; use SimpleSAML\XMLSchema\Exception\SchemaViolationException; use SimpleSAML\XMLSchema\Type\AnyURIValue; @@ -222,10 +222,10 @@ public function isEmptyElement(): bool /** * Convert this tDefinitions to XML. * - * @param \DOMElement|null $parent The element we are converting to XML. - * @return \DOMElement The XML element after adding the data corresponding to this tDefinitions. + * @param \Dom\Element|null $parent The element we are converting to XML. + * @return \Dom\Element The XML element after adding the data corresponding to this tDefinitions. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = parent::toXML($parent); diff --git a/src/XML/wsdl/AbstractDocumented.php b/src/XML/wsdl/AbstractDocumented.php index 8473d9d..f7fd1a3 100644 --- a/src/XML/wsdl/AbstractDocumented.php +++ b/src/XML/wsdl/AbstractDocumented.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; /** * Abstract class representing the tDocumented type. @@ -47,10 +47,10 @@ public function isEmptyElement(): bool /** * Convert this tDocumented to XML. * - * @param \DOMElement|null $parent The element we are converting to XML. - * @return \DOMElement The XML element after adding the data corresponding to this tDocumented. + * @param \Dom\Element|null $parent The element we are converting to XML. + * @return \Dom\Element The XML element after adding the data corresponding to this tDocumented. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = $this->instantiateParentElement($parent); diff --git a/src/XML/wsdl/AbstractExtensibilityElement.php b/src/XML/wsdl/AbstractExtensibilityElement.php index 7688595..9dba6d3 100644 --- a/src/XML/wsdl/AbstractExtensibilityElement.php +++ b/src/XML/wsdl/AbstractExtensibilityElement.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\WSDL\Type\RequiredValue; /** @@ -48,10 +48,10 @@ public function isEmptyElement(): bool /** * Convert this tExtensibilityElement to XML. * - * @param \DOMElement|null $parent The element we are converting to XML. - * @return \DOMElement The XML element after adding the data corresponding to this tExtensibilityElement + * @param \Dom\Element|null $parent The element we are converting to XML. + * @return \Dom\Element The XML element after adding the data corresponding to this tExtensibilityElement */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = $this->instantiateParentElement($parent); $this->getRequired()?->toAttribute()->toXML($e); diff --git a/src/XML/wsdl/AbstractExtensibleAttributesDocumented.php b/src/XML/wsdl/AbstractExtensibleAttributesDocumented.php index 7ef6847..2fadf82 100644 --- a/src/XML/wsdl/AbstractExtensibleAttributesDocumented.php +++ b/src/XML/wsdl/AbstractExtensibleAttributesDocumented.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XMLSchema\XML\Constants\NS; @@ -46,10 +46,10 @@ public function isEmptyElement(): bool /** * Convert this tExtensibleAttributesDocumented to XML. * - * @param \DOMElement|null $parent The element we are converting to XML. - * @return \DOMElement The XML element after adding the data corresponding to this tExtensibleAttributesDocumented. + * @param \Dom\Element|null $parent The element we are converting to XML. + * @return \Dom\Element The XML element after adding the data corresponding to this tExtensibleAttributesDocumented. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = parent::toXML($parent); diff --git a/src/XML/wsdl/AbstractExtensibleDocumented.php b/src/XML/wsdl/AbstractExtensibleDocumented.php index b66c340..1f09db5 100644 --- a/src/XML/wsdl/AbstractExtensibleDocumented.php +++ b/src/XML/wsdl/AbstractExtensibleDocumented.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XMLSchema\XML\Constants\NS; @@ -46,10 +46,10 @@ public function isEmptyElement(): bool /** * Convert this tExtensibleDocumented to XML. * - * @param \DOMElement|null $parent The element we are converting to XML. - * @return \DOMElement The XML element after adding the data corresponding to this tExtensibleDocumented. + * @param \Dom\Element|null $parent The element we are converting to XML. + * @return \Dom\Element The XML element after adding the data corresponding to this tExtensibleDocumented. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = parent::toXML($parent); diff --git a/src/XML/wsdl/AbstractFault.php b/src/XML/wsdl/AbstractFault.php index f6f15b1..e08a7f8 100644 --- a/src/XML/wsdl/AbstractFault.php +++ b/src/XML/wsdl/AbstractFault.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\XMLSchema\Type\NCNameValue; use SimpleSAML\XMLSchema\Type\QNameValue; @@ -66,10 +66,10 @@ public function isEmptyElement(): bool /** * Convert this tParam to XML. * - * @param \DOMElement|null $parent The element we are converting to XML. - * @return \DOMElement The XML element after adding the data corresponding to this tParam. + * @param \Dom\Element|null $parent The element we are converting to XML. + * @return \Dom\Element The XML element after adding the data corresponding to this tParam. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = parent::toXML($parent); diff --git a/src/XML/wsdl/AbstractImport.php b/src/XML/wsdl/AbstractImport.php index b4fe2d8..fbe4c66 100644 --- a/src/XML/wsdl/AbstractImport.php +++ b/src/XML/wsdl/AbstractImport.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\XMLSchema\Type\AnyURIValue; /** @@ -65,10 +65,10 @@ public function isEmptyElement(): bool /** * Convert this tImport to XML. * - * @param \DOMElement|null $parent The element we are converting to XML. - * @return \DOMElement The XML element after adding the data corresponding to this tImport. + * @param \Dom\Element|null $parent The element we are converting to XML. + * @return \Dom\Element The XML element after adding the data corresponding to this tImport. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = parent::toXML($parent); diff --git a/src/XML/wsdl/AbstractMessage.php b/src/XML/wsdl/AbstractMessage.php index 31efd37..f4dfb96 100644 --- a/src/XML/wsdl/AbstractMessage.php +++ b/src/XML/wsdl/AbstractMessage.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\WSDL\Assert\Assert; use SimpleSAML\XMLSchema\Exception\SchemaViolationException; use SimpleSAML\XMLSchema\Type\NCNameValue; @@ -79,10 +79,10 @@ public function isEmptyElement(): bool /** * Convert this tParam to XML. * - * @param \DOMElement|null $parent The element we are converting to XML. - * @return \DOMElement The XML element after adding the data corresponding to this tParam. + * @param \Dom\Element|null $parent The element we are converting to XML. + * @return \Dom\Element The XML element after adding the data corresponding to this tParam. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = parent::toXML($parent); $e->setAttribute('name', $this->getName()->getValue()); diff --git a/src/XML/wsdl/AbstractParam.php b/src/XML/wsdl/AbstractParam.php index 0ac4d14..7030a8a 100644 --- a/src/XML/wsdl/AbstractParam.php +++ b/src/XML/wsdl/AbstractParam.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\XMLSchema\Type\NCNameValue; use SimpleSAML\XMLSchema\Type\QNameValue; @@ -66,10 +66,10 @@ public function isEmptyElement(): bool /** * Convert this tParam to XML. * - * @param \DOMElement|null $parent The element we are converting to XML. - * @return \DOMElement The XML element after adding the data corresponding to this tParam. + * @param \Dom\Element|null $parent The element we are converting to XML. + * @return \Dom\Element The XML element after adding the data corresponding to this tParam. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = parent::toXML($parent); diff --git a/src/XML/wsdl/AbstractPart.php b/src/XML/wsdl/AbstractPart.php index d56945d..70c6baa 100644 --- a/src/XML/wsdl/AbstractPart.php +++ b/src/XML/wsdl/AbstractPart.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\XMLSchema\Type\NCNameValue; use SimpleSAML\XMLSchema\Type\QNameValue; @@ -79,10 +79,10 @@ public function isEmptyElement(): bool /** * Convert this tPart to XML. * - * @param \DOMElement|null $parent The element we are converting to XML. - * @return \DOMElement The XML element after adding the data corresponding to this tPart. + * @param \Dom\Element|null $parent The element we are converting to XML. + * @return \Dom\Element The XML element after adding the data corresponding to this tPart. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = parent::toXML($parent); diff --git a/src/XML/wsdl/AbstractPort.php b/src/XML/wsdl/AbstractPort.php index 3f696b3..319ccca 100644 --- a/src/XML/wsdl/AbstractPort.php +++ b/src/XML/wsdl/AbstractPort.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\XMLSchema\Type\NCNameValue; use SimpleSAML\XMLSchema\Type\QNameValue; @@ -66,10 +66,10 @@ public function isEmptyElement(): bool /** * Convert this tPort to XML. * - * @param \DOMElement|null $parent The element we are converting to XML. - * @return \DOMElement The XML element after adding the data corresponding to this tPort. + * @param \Dom\Element|null $parent The element we are converting to XML. + * @return \Dom\Element The XML element after adding the data corresponding to this tPort. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = parent::toXML($parent); diff --git a/src/XML/wsdl/AbstractPortType.php b/src/XML/wsdl/AbstractPortType.php index 99eaf80..4edfd57 100644 --- a/src/XML/wsdl/AbstractPortType.php +++ b/src/XML/wsdl/AbstractPortType.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\WSDL\Assert\Assert; use SimpleSAML\XMLSchema\Exception\SchemaViolationException; use SimpleSAML\XMLSchema\Type\NCNameValue; @@ -69,10 +69,10 @@ public function isEmptyElement(): bool /** * Convert this tPortType to XML. * - * @param \DOMElement|null $parent The element we are converting to XML. - * @return \DOMElement The XML element after adding the data corresponding to this tPortType. + * @param \Dom\Element|null $parent The element we are converting to XML. + * @return \Dom\Element The XML element after adding the data corresponding to this tPortType. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = parent::toXML($parent); diff --git a/src/XML/wsdl/AbstractPortTypeOperation.php b/src/XML/wsdl/AbstractPortTypeOperation.php index 6cbcdb8..720df5e 100644 --- a/src/XML/wsdl/AbstractPortTypeOperation.php +++ b/src/XML/wsdl/AbstractPortTypeOperation.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\WSDL\Assert\Assert; use SimpleSAML\XMLSchema\Exception\SchemaViolationException; use SimpleSAML\XMLSchema\Type\NCNameValue; @@ -99,10 +99,10 @@ public function getFault(): array /** * Convert this RequestResponseOrOneWayOperation to XML. * - * @param \DOMElement|null $parent The element we should add this organization to. - * @return \DOMElement This Organization-element. + * @param \Dom\Element|null $parent The element we should add this organization to. + * @return \Dom\Element This Organization-element. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = $this->instantiateParentElement($parent); $e->setAttribute('name', $this->getName()->getValue()); diff --git a/src/XML/wsdl/AbstractService.php b/src/XML/wsdl/AbstractService.php index 851b0dd..aa405cb 100644 --- a/src/XML/wsdl/AbstractService.php +++ b/src/XML/wsdl/AbstractService.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\WSDL\Assert\Assert; use SimpleSAML\XMLSchema\Exception\SchemaViolationException; use SimpleSAML\XMLSchema\Type\NCNameValue; @@ -79,10 +79,10 @@ public function isEmptyElement(): bool /** * Convert this tService to XML. * - * @param \DOMElement|null $parent The element we are converting to XML. - * @return \DOMElement The XML element after adding the data corresponding to this tService. + * @param \Dom\Element|null $parent The element we are converting to XML. + * @return \Dom\Element The XML element after adding the data corresponding to this tService. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = parent::toXML($parent); diff --git a/src/XML/wsdl/Binding.php b/src/XML/wsdl/Binding.php index 623d674..c6eb731 100644 --- a/src/XML/wsdl/Binding.php +++ b/src/XML/wsdl/Binding.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\Assert\Assert; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Type\NCNameValue; @@ -23,12 +23,12 @@ final class Binding extends AbstractBinding /** * Initialize a Binding element. * - * @param \DOMElement $xml The XML element we should load. + * @param \Dom\Element $xml The XML element we should load. * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::LOCALNAME, InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); diff --git a/src/XML/wsdl/BindingOperation.php b/src/XML/wsdl/BindingOperation.php index 0316f84..6a1a137 100644 --- a/src/XML/wsdl/BindingOperation.php +++ b/src/XML/wsdl/BindingOperation.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\Assert\Assert; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Type\NCNameValue; @@ -24,12 +24,12 @@ final class BindingOperation extends AbstractBindingOperation /** * Initialize a BindingOperation element. * - * @param \DOMElement $xml The XML element we should load. + * @param \Dom\Element $xml The XML element we should load. * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::LOCALNAME, InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); diff --git a/src/XML/wsdl/BindingOperationFault.php b/src/XML/wsdl/BindingOperationFault.php index 4b0ed94..db8c972 100644 --- a/src/XML/wsdl/BindingOperationFault.php +++ b/src/XML/wsdl/BindingOperationFault.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\Assert\Assert; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Type\NCNameValue; @@ -22,12 +22,12 @@ final class BindingOperationFault extends AbstractBindingOperationFault /** * Initialize a Fault element. * - * @param \DOMElement $xml The XML element we should load. + * @param \Dom\Element $xml The XML element we should load. * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::LOCALNAME, InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); diff --git a/src/XML/wsdl/BindingOperationInput.php b/src/XML/wsdl/BindingOperationInput.php index 96b389a..d97a947 100644 --- a/src/XML/wsdl/BindingOperationInput.php +++ b/src/XML/wsdl/BindingOperationInput.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\Assert\Assert; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Type\NCNameValue; @@ -22,12 +22,12 @@ final class BindingOperationInput extends AbstractBindingOperationMessage /** * Initialize a Input element. * - * @param \DOMElement $xml The XML element we should load. + * @param \Dom\Element $xml The XML element we should load. * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::LOCALNAME, InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); diff --git a/src/XML/wsdl/BindingOperationOutput.php b/src/XML/wsdl/BindingOperationOutput.php index 78a23c6..0ca18dd 100644 --- a/src/XML/wsdl/BindingOperationOutput.php +++ b/src/XML/wsdl/BindingOperationOutput.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\Assert\Assert; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Type\NCNameValue; @@ -22,12 +22,12 @@ final class BindingOperationOutput extends AbstractBindingOperationMessage /** * Initialize a Output element. * - * @param \DOMElement $xml The XML element we should load. + * @param \Dom\Element $xml The XML element we should load. * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::LOCALNAME, InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); diff --git a/src/XML/wsdl/Definitions.php b/src/XML/wsdl/Definitions.php index 1dc7836..3e8f2e8 100644 --- a/src/XML/wsdl/Definitions.php +++ b/src/XML/wsdl/Definitions.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\Assert\Assert; use SimpleSAML\XML\SchemaValidatableElementInterface; use SimpleSAML\XML\SchemaValidatableElementTrait; @@ -33,12 +33,12 @@ final class Definitions extends AbstractDefinitions implements SchemaValidatable /** * Initialize a Definitions element. * - * @param \DOMElement $xml The XML element we should load. + * @param \Dom\Element $xml The XML element we should load. * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::LOCALNAME, InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); diff --git a/src/XML/wsdl/Fault.php b/src/XML/wsdl/Fault.php index 2de0c10..483571a 100644 --- a/src/XML/wsdl/Fault.php +++ b/src/XML/wsdl/Fault.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\Assert\Assert; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Type\NCNameValue; @@ -23,12 +23,12 @@ final class Fault extends AbstractFault /** * Initialize a Fault element. * - * @param \DOMElement $xml The XML element we should load. + * @param \Dom\Element $xml The XML element we should load. * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::LOCALNAME, InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); diff --git a/src/XML/wsdl/Import.php b/src/XML/wsdl/Import.php index 049e0c2..17d7a3b 100644 --- a/src/XML/wsdl/Import.php +++ b/src/XML/wsdl/Import.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\Assert\Assert; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Type\AnyURIValue; @@ -22,12 +22,12 @@ final class Import extends AbstractImport /** * Initialize a Import element. * - * @param \DOMElement $xml The XML element we should load. + * @param \Dom\Element $xml The XML element we should load. * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::LOCALNAME, InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); diff --git a/src/XML/wsdl/Input.php b/src/XML/wsdl/Input.php index ffc41b0..d12ec76 100644 --- a/src/XML/wsdl/Input.php +++ b/src/XML/wsdl/Input.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\Assert\Assert; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Type\NCNameValue; @@ -23,12 +23,12 @@ final class Input extends AbstractParam /** * Initialize a input-element. * - * @param \DOMElement $xml The XML element we should load. + * @param \Dom\Element $xml The XML element we should load. * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::LOCALNAME, InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); diff --git a/src/XML/wsdl/Message.php b/src/XML/wsdl/Message.php index 7811233..d9194af 100644 --- a/src/XML/wsdl/Message.php +++ b/src/XML/wsdl/Message.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\Assert\Assert; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Type\NCNameValue; @@ -22,12 +22,12 @@ final class Message extends AbstractMessage /** * Initialize a message-element. * - * @param \DOMElement $xml The XML element we should load. + * @param \Dom\Element $xml The XML element we should load. * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::LOCALNAME, InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); diff --git a/src/XML/wsdl/Output.php b/src/XML/wsdl/Output.php index 4f4ca6e..6c26937 100644 --- a/src/XML/wsdl/Output.php +++ b/src/XML/wsdl/Output.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\Assert\Assert; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Type\NCNameValue; @@ -23,12 +23,12 @@ final class Output extends AbstractParam /** * Initialize a output-element. * - * @param \DOMElement $xml The XML element we should load. + * @param \Dom\Element $xml The XML element we should load. * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::LOCALNAME, InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); diff --git a/src/XML/wsdl/Part.php b/src/XML/wsdl/Part.php index e2a5390..56de05f 100644 --- a/src/XML/wsdl/Part.php +++ b/src/XML/wsdl/Part.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\Assert\Assert; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Type\NCNameValue; @@ -23,12 +23,12 @@ final class Part extends AbstractPart /** * Initialize a Part element. * - * @param \DOMElement $xml The XML element we should load. + * @param \Dom\Element $xml The XML element we should load. * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::LOCALNAME, InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); diff --git a/src/XML/wsdl/Port.php b/src/XML/wsdl/Port.php index 9000d64..a4611e4 100644 --- a/src/XML/wsdl/Port.php +++ b/src/XML/wsdl/Port.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\Assert\Assert; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Type\NCNameValue; @@ -23,12 +23,12 @@ final class Port extends AbstractPort /** * Initialize a Port element. * - * @param \DOMElement $xml The XML element we should load. + * @param \Dom\Element $xml The XML element we should load. * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::LOCALNAME, InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); diff --git a/src/XML/wsdl/PortType.php b/src/XML/wsdl/PortType.php index 718bfe7..8aebf2b 100644 --- a/src/XML/wsdl/PortType.php +++ b/src/XML/wsdl/PortType.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\Assert\Assert; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Type\NCNameValue; @@ -22,12 +22,12 @@ final class PortType extends AbstractPortType /** * Initialize a PortType element. * - * @param \DOMElement $xml The XML element we should load. + * @param \Dom\Element $xml The XML element we should load. * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::LOCALNAME, InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); diff --git a/src/XML/wsdl/PortTypeOperation.php b/src/XML/wsdl/PortTypeOperation.php index 41d877c..900b283 100644 --- a/src/XML/wsdl/PortTypeOperation.php +++ b/src/XML/wsdl/PortTypeOperation.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\Assert\Assert; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Exception\SchemaViolationException; @@ -24,19 +24,19 @@ final class PortTypeOperation extends AbstractPortTypeOperation /** * Initialize a Operation element. * - * @param \DOMElement $xml The XML element we should load. + * @param \Dom\Element $xml The XML element we should load. * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::LOCALNAME, InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); $first = null; foreach ($xml->childNodes as $element) { - if (!($element instanceof DOMElement)) { + if (!($element instanceof Dom\Element)) { continue; } elseif ($element->namespaceURI === static::NS) { if ($element->localName === 'input') { diff --git a/src/XML/wsdl/Service.php b/src/XML/wsdl/Service.php index e8008a0..01f9895 100644 --- a/src/XML/wsdl/Service.php +++ b/src/XML/wsdl/Service.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\Assert\Assert; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Type\NCNameValue; @@ -22,12 +22,12 @@ final class Service extends AbstractService /** * Initialize a Service element. * - * @param \DOMElement $xml The XML element we should load. + * @param \Dom\Element $xml The XML element we should load. * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::LOCALNAME, InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); diff --git a/src/XML/wsdl/Types.php b/src/XML/wsdl/Types.php index 820ab1c..5a32f41 100644 --- a/src/XML/wsdl/Types.php +++ b/src/XML/wsdl/Types.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WSDL\XML\wsdl; -use DOMElement; +use Dom; use SimpleSAML\Assert\Assert; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; @@ -21,12 +21,12 @@ final class Types extends AbstractTypes /** * Initialize a types-element. * - * @param \DOMElement $xml The XML element we should load. + * @param \Dom\Element $xml The XML element we should load. * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::LOCALNAME, InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); diff --git a/tests/WSDL/XML/soap12/AddressTest.php b/tests/WSDL/XML/soap12/AddressTest.php index e623828..4a87fa5 100644 --- a/tests/WSDL/XML/soap12/AddressTest.php +++ b/tests/WSDL/XML/soap12/AddressTest.php @@ -61,9 +61,10 @@ public function testMarshalling(): void RequiredValue::fromBoolean(true), ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($address), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($address); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/WSDL/XML/soap12/BindingTest.php b/tests/WSDL/XML/soap12/BindingTest.php index cbe2d15..0406040 100644 --- a/tests/WSDL/XML/soap12/BindingTest.php +++ b/tests/WSDL/XML/soap12/BindingTest.php @@ -65,10 +65,11 @@ public function testMarshalling(): void RequiredValue::fromBoolean(true), ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($binding), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($binding); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } diff --git a/tests/WSDL/XML/soap12/BodyTest.php b/tests/WSDL/XML/soap12/BodyTest.php index 810567d..35f6e38 100644 --- a/tests/WSDL/XML/soap12/BodyTest.php +++ b/tests/WSDL/XML/soap12/BodyTest.php @@ -68,10 +68,11 @@ public function testMarshalling(): void RequiredValue::fromBoolean(true), ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($body), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($body); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } diff --git a/tests/WSDL/XML/soap12/FaultTest.php b/tests/WSDL/XML/soap12/FaultTest.php index ace9d8f..4136f4b 100644 --- a/tests/WSDL/XML/soap12/FaultTest.php +++ b/tests/WSDL/XML/soap12/FaultTest.php @@ -67,9 +67,10 @@ public function testMarshalling(): void RequiredValue::fromBoolean(true), ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($fault), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($fault); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/WSDL/XML/soap12/HeaderFaultTest.php b/tests/WSDL/XML/soap12/HeaderFaultTest.php index 8b0bea5..9df38b8 100644 --- a/tests/WSDL/XML/soap12/HeaderFaultTest.php +++ b/tests/WSDL/XML/soap12/HeaderFaultTest.php @@ -67,9 +67,10 @@ public function testMarshalling(): void AnyURIValue::fromString('urn:x-simplesamlphp:namespace'), ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($headerFault), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($headerFault); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/WSDL/XML/soap12/HeaderTest.php b/tests/WSDL/XML/soap12/HeaderTest.php index 1a8b4eb..5db1821 100644 --- a/tests/WSDL/XML/soap12/HeaderTest.php +++ b/tests/WSDL/XML/soap12/HeaderTest.php @@ -79,9 +79,10 @@ public function testMarshalling(): void RequiredValue::fromBoolean(true), ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($header), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($header); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/WSDL/XML/soap12/OperationTest.php b/tests/WSDL/XML/soap12/OperationTest.php index 400a325..77f65db 100644 --- a/tests/WSDL/XML/soap12/OperationTest.php +++ b/tests/WSDL/XML/soap12/OperationTest.php @@ -67,10 +67,11 @@ public function testMarshalling(): void RequiredValue::fromBoolean(true), ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($operation), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($operation); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } diff --git a/tests/WSDL/XML/wsdl/BindingOperationTest.php b/tests/WSDL/XML/wsdl/BindingOperationTest.php index c5e3516..407b635 100644 --- a/tests/WSDL/XML/wsdl/BindingOperationTest.php +++ b/tests/WSDL/XML/wsdl/BindingOperationTest.php @@ -100,9 +100,10 @@ public function testMarshalling(): void [new Chunk($child->documentElement)], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($bindingOperation), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($bindingOperation); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/WSDL/XML/wsdl/BindingTest.php b/tests/WSDL/XML/wsdl/BindingTest.php index dad74e4..161d316 100644 --- a/tests/WSDL/XML/wsdl/BindingTest.php +++ b/tests/WSDL/XML/wsdl/BindingTest.php @@ -113,9 +113,10 @@ public function testMarshalling(): void [new Chunk($child->documentElement)], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($binding), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($binding); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/WSDL/XML/wsdl/DefinitionsTest.php b/tests/WSDL/XML/wsdl/DefinitionsTest.php index 72b1d01..123fc9e 100644 --- a/tests/WSDL/XML/wsdl/DefinitionsTest.php +++ b/tests/WSDL/XML/wsdl/DefinitionsTest.php @@ -248,9 +248,10 @@ public function testMarshalling(): void [new Chunk($child->documentElement)], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($definitions), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($definitions); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/WSDL/XML/wsdl/FaultTest.php b/tests/WSDL/XML/wsdl/FaultTest.php index f32b2f2..60b58c6 100644 --- a/tests/WSDL/XML/wsdl/FaultTest.php +++ b/tests/WSDL/XML/wsdl/FaultTest.php @@ -64,9 +64,10 @@ public function testMarshalling(): void [$attr1], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($fault), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($fault); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/WSDL/XML/wsdl/ImportTest.php b/tests/WSDL/XML/wsdl/ImportTest.php index e7bef14..debb2c4 100644 --- a/tests/WSDL/XML/wsdl/ImportTest.php +++ b/tests/WSDL/XML/wsdl/ImportTest.php @@ -63,9 +63,10 @@ public function testMarshalling(): void [$attr1], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($import), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($import); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/WSDL/XML/wsdl/InputTest.php b/tests/WSDL/XML/wsdl/InputTest.php index 734576d..1726ac9 100644 --- a/tests/WSDL/XML/wsdl/InputTest.php +++ b/tests/WSDL/XML/wsdl/InputTest.php @@ -66,9 +66,10 @@ public function testMarshalling(): void [$attr1], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($input), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($input); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/WSDL/XML/wsdl/MessageTest.php b/tests/WSDL/XML/wsdl/MessageTest.php index 8bca35f..5313569 100644 --- a/tests/WSDL/XML/wsdl/MessageTest.php +++ b/tests/WSDL/XML/wsdl/MessageTest.php @@ -86,10 +86,11 @@ public function testMarshalling(): void [new Chunk($child->documentElement)], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($message), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($message); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } diff --git a/tests/WSDL/XML/wsdl/OutputTest.php b/tests/WSDL/XML/wsdl/OutputTest.php index 1c6b4ff..efcd285 100644 --- a/tests/WSDL/XML/wsdl/OutputTest.php +++ b/tests/WSDL/XML/wsdl/OutputTest.php @@ -66,9 +66,10 @@ public function testMarshalling(): void [$attr1], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($output), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($output); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/WSDL/XML/wsdl/PartTest.php b/tests/WSDL/XML/wsdl/PartTest.php index 0b23760..5bd4817 100644 --- a/tests/WSDL/XML/wsdl/PartTest.php +++ b/tests/WSDL/XML/wsdl/PartTest.php @@ -65,9 +65,10 @@ public function testMarshalling(): void [$attr1], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($part), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($part); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/WSDL/XML/wsdl/PortTest.php b/tests/WSDL/XML/wsdl/PortTest.php index 902515b..c4b9404 100644 --- a/tests/WSDL/XML/wsdl/PortTest.php +++ b/tests/WSDL/XML/wsdl/PortTest.php @@ -65,9 +65,10 @@ public function testMarshalling(): void [new Chunk($child->documentElement)], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($port), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($port); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/WSDL/XML/wsdl/PortTypeOperationInputTest.php b/tests/WSDL/XML/wsdl/PortTypeOperationInputTest.php index 93d9341..12fb491 100644 --- a/tests/WSDL/XML/wsdl/PortTypeOperationInputTest.php +++ b/tests/WSDL/XML/wsdl/PortTypeOperationInputTest.php @@ -93,9 +93,10 @@ public function testMarshalling(): void [$fault], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($operation), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($operation); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/WSDL/XML/wsdl/PortTypeOperationOutputTest.php b/tests/WSDL/XML/wsdl/PortTypeOperationOutputTest.php index 708cc0f..d9ab365 100644 --- a/tests/WSDL/XML/wsdl/PortTypeOperationOutputTest.php +++ b/tests/WSDL/XML/wsdl/PortTypeOperationOutputTest.php @@ -93,9 +93,10 @@ public function testMarshalling(): void [$fault], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($operation), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($operation); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/WSDL/XML/wsdl/PortTypeTest.php b/tests/WSDL/XML/wsdl/PortTypeTest.php index 13a61d5..ff4ae23 100644 --- a/tests/WSDL/XML/wsdl/PortTypeTest.php +++ b/tests/WSDL/XML/wsdl/PortTypeTest.php @@ -103,9 +103,10 @@ public function testMarshalling(): void $portType = new PortType(NCNameValue::fromString('MyPort'), [$inputOperation, $outputOperation], [$port]); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($portType), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($portType); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/WSDL/XML/wsdl/ServiceTest.php b/tests/WSDL/XML/wsdl/ServiceTest.php index 2c6bd4b..3dfd5c7 100644 --- a/tests/WSDL/XML/wsdl/ServiceTest.php +++ b/tests/WSDL/XML/wsdl/ServiceTest.php @@ -82,10 +82,11 @@ public function testMarshalling(): void [$portOne, $portTwo], [new Chunk($child->documentElement)], ); -//var_dump(strval($service)); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($service), - ); + + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($service); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/WSDL/XML/wsdl/TypesTest.php b/tests/WSDL/XML/wsdl/TypesTest.php index 04c5083..088c0a1 100644 --- a/tests/WSDL/XML/wsdl/TypesTest.php +++ b/tests/WSDL/XML/wsdl/TypesTest.php @@ -59,9 +59,10 @@ public function testMarshalling(): void $types = new Types([new Chunk($child->documentElement)]); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($types), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($types); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } From 84f8a6fe9ca8978420500541b6952ad04545f70d Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sun, 31 May 2026 13:59:35 +0200 Subject: [PATCH 2/3] Properly insert xmlns-attributes when dealing with an xs:QName attribute --- src/XML/soap12/AbstractHeader.php | 20 ++++++++++++++++---- src/XML/soap12/AbstractHeaderFault.php | 12 ++++++++++++ src/XML/wsdl/AbstractBinding.php | 14 ++++++++++++++ src/XML/wsdl/AbstractFault.php | 13 +++++++++++++ src/XML/wsdl/AbstractPart.php | 22 ++++++++++++++++++++++ src/XML/wsdl/AbstractPort.php | 13 +++++++++++++ 6 files changed, 90 insertions(+), 4 deletions(-) diff --git a/src/XML/soap12/AbstractHeader.php b/src/XML/soap12/AbstractHeader.php index 25e0d25..d3b80a1 100644 --- a/src/XML/soap12/AbstractHeader.php +++ b/src/XML/soap12/AbstractHeader.php @@ -6,7 +6,9 @@ use Dom; use SimpleSAML\Assert\Assert; -use SimpleSAML\WSDL\Constants as C; +use SimpleSAML\XML\Attribute as XMLAttribute; +use SimpleSAML\XML\Constants as C; +use SimpleSAML\WSDL\Constants as C_WSDL; use SimpleSAML\WSDL\Type\RequiredValue; use SimpleSAML\WSDL\Type\UseChoiceValue; use SimpleSAML\WSDL\XML\wsdl\AbstractExtensibilityElement; @@ -26,7 +28,7 @@ abstract class AbstractHeader extends AbstractExtensibilityElement use BodyAttributesTrait; - public const string NS = C::NS_WSDL_SOAP_12; + public const string NS = C_WSDL::NS_WSDL_SOAP_12; public const string NS_PREFIX = 'soap12'; @@ -113,8 +115,8 @@ public static function fromXML(Dom\Element $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); $required = null; - if ($xml->hasAttributeNS(C::NS_WSDL, 'required')) { - $required = RequiredValue::fromString($xml->getAttributeNS(C::NS_WSDL, 'required')); + if ($xml->hasAttributeNS(C_WSDL::NS_WSDL, 'required')) { + $required = RequiredValue::fromString($xml->getAttributeNS(C_WSDL::NS_WSDL, 'required')); } return new static( @@ -139,6 +141,16 @@ public function toXML(?Dom\Element $parent = null): Dom\Element { $e = parent::toXML($parent); + if (!$e->lookupPrefix($this->getMessage()->getNamespacePrefix()->getValue())) { + $namespace = new XMLAttribute( + C::NS_XMLNS, + 'xmlns', + $this->getMessage()->getNamespacePrefix()->getValue(), + $this->getMessage()->getNamespaceURI(), + ); + $namespace->toXML($e); + } + $e->setAttribute('message', $this->getMessage()->getValue()); $e->setAttribute('parts', $this->getParts()->getValue()); $e->setAttribute('use', $this->getUse()->getValue()); diff --git a/src/XML/soap12/AbstractHeaderFault.php b/src/XML/soap12/AbstractHeaderFault.php index b447406..e319a1e 100644 --- a/src/XML/soap12/AbstractHeaderFault.php +++ b/src/XML/soap12/AbstractHeaderFault.php @@ -6,6 +6,8 @@ use Dom; use SimpleSAML\WSDL\Assert\Assert; +use SimpleSAML\XML\Attribute as XMLAttribute; +use SimpleSAML\XML\Constants as C; use SimpleSAML\WSDL\Type\UseChoiceValue; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Type\AnyURIValue; @@ -103,6 +105,16 @@ public function toXML(?Dom\Element $parent = null): Dom\Element { $e = $this->instantiateParentElement($parent); + if (!$e->lookupPrefix($this->getMessage()->getNamespacePrefix()->getValue())) { + $namespace = new XMLAttribute( + C::NS_XMLNS, + 'xmlns', + $this->getMessage()->getNamespacePrefix()->getValue(), + $this->getMessage()->getNamespaceURI(), + ); + $namespace->toXML($e); + } + $e->setAttribute('message', $this->getMessage()->getValue()); $e->setAttribute('parts', $this->getParts()->getValue()); $e->setAttribute('use', $this->getUse()->getValue()); diff --git a/src/XML/wsdl/AbstractBinding.php b/src/XML/wsdl/AbstractBinding.php index e0d934a..9d7833f 100644 --- a/src/XML/wsdl/AbstractBinding.php +++ b/src/XML/wsdl/AbstractBinding.php @@ -6,6 +6,8 @@ use Dom; use SimpleSAML\WSDL\Assert\Assert; +use SimpleSAML\XML\Attribute as XMLAttribute; +use SimpleSAML\XML\Constants as C; use SimpleSAML\XMLSchema\Exception\SchemaViolationException; use SimpleSAML\XMLSchema\Type\NCNameValue; use SimpleSAML\XMLSchema\Type\QNameValue; @@ -91,6 +93,18 @@ public function toXML(?Dom\Element $parent = null): Dom\Element $e = parent::toXML($parent); $e->setAttribute('name', $this->getName()->getValue()); + + + if (!$e->lookupPrefix($this->getType()->getNamespacePrefix()->getValue())) { + $namespace = new XMLAttribute( + C::NS_XMLNS, + 'xmlns', + $this->getType()->getNamespacePrefix()->getValue(), + $this->getType()->getNamespaceURI(), + ); + $namespace->toXML($e); + } + $e->setAttribute('type', $this->getType()->getValue()); foreach ($this->getOperation() as $operation) { diff --git a/src/XML/wsdl/AbstractFault.php b/src/XML/wsdl/AbstractFault.php index e08a7f8..7127bc5 100644 --- a/src/XML/wsdl/AbstractFault.php +++ b/src/XML/wsdl/AbstractFault.php @@ -5,6 +5,8 @@ namespace SimpleSAML\WSDL\XML\wsdl; use Dom; +use SimpleSAML\XML\Attribute as XMLAttribute; +use SimpleSAML\XML\Constants as C; use SimpleSAML\XMLSchema\Type\NCNameValue; use SimpleSAML\XMLSchema\Type\QNameValue; @@ -74,6 +76,17 @@ public function toXML(?Dom\Element $parent = null): Dom\Element $e = parent::toXML($parent); $e->setAttribute('name', $this->getName()->getValue()); + + if (!$e->lookupPrefix($this->getMessage()->getNamespacePrefix()->getValue())) { + $namespace = new XMLAttribute( + C::NS_XMLNS, + 'xmlns', + $this->getMessage()->getNamespacePrefix()->getValue(), + $this->getMessage()->getNamespaceURI(), + ); + $namespace->toXML($e); + } + $e->setAttribute('message', $this->getMessage()->getValue()); return $e; diff --git a/src/XML/wsdl/AbstractPart.php b/src/XML/wsdl/AbstractPart.php index 70c6baa..01f1f7f 100644 --- a/src/XML/wsdl/AbstractPart.php +++ b/src/XML/wsdl/AbstractPart.php @@ -5,6 +5,8 @@ namespace SimpleSAML\WSDL\XML\wsdl; use Dom; +use SimpleSAML\XML\Attribute as XMLAttribute; +use SimpleSAML\XML\Constants as C; use SimpleSAML\XMLSchema\Type\NCNameValue; use SimpleSAML\XMLSchema\Type\QNameValue; @@ -89,10 +91,30 @@ public function toXML(?Dom\Element $parent = null): Dom\Element $e->setAttribute('name', $this->getName()->getValue()); if ($this->getElement() !== null) { + if (!$e->lookupPrefix($this->getElement()->getNamespacePrefix()->getValue())) { + $namespace = new XMLAttribute( + C::NS_XMLNS, + 'xmlns', + $this->getElement()->getNamespacePrefix()->getValue(), + $this->getElement()->getNamespaceURI(), + ); + $namespace->toXML($e); + } + $e->setAttribute('element', $this->getElement()->getValue()); } if ($this->getType() !== null) { + if (!$e->lookupPrefix($this->getType()->getNamespacePrefix()->getValue())) { + $namespace = new XMLAttribute( + C::NS_XMLNS, + 'xmlns', + $this->getType()->getNamespacePrefix()->getValue(), + $this->getType()->getNamespaceURI(), + ); + $namespace->toXML($e); + } + $e->setAttribute('type', $this->getType()->getValue()); } diff --git a/src/XML/wsdl/AbstractPort.php b/src/XML/wsdl/AbstractPort.php index 319ccca..906a921 100644 --- a/src/XML/wsdl/AbstractPort.php +++ b/src/XML/wsdl/AbstractPort.php @@ -5,6 +5,8 @@ namespace SimpleSAML\WSDL\XML\wsdl; use Dom; +use SimpleSAML\XML\Attribute as XMLAttribute; +use SimpleSAML\XML\Constants as C; use SimpleSAML\XMLSchema\Type\NCNameValue; use SimpleSAML\XMLSchema\Type\QNameValue; @@ -74,6 +76,17 @@ public function toXML(?Dom\Element $parent = null): Dom\Element $e = parent::toXML($parent); $e->setAttribute('name', $this->getName()->getValue()); + + if (!$e->lookupPrefix($this->getBinding()->getNamespacePrefix()->getValue())) { + $namespace = new XMLAttribute( + C::NS_XMLNS, + 'xmlns', + $this->getBinding()->getNamespacePrefix()->getValue(), + $this->getBinding()->getNamespaceURI(), + ); + $namespace->toXML($e); + } + $e->setAttribute('binding', $this->getBinding()->getValue()); return $e; From c0c45092133f8cef802b0b5ced3483ecc7dae5b7 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 2 Jun 2026 11:40:24 +0200 Subject: [PATCH 3/3] Migrate DOM-classes to PHP 8.4's new DOM-API --- src/Utils/XPath.php | 11 +++++------ tests/resources/xml/wsdl/PortTypeOperation_Input.xml | 8 ++++---- tests/resources/xml/wsdl/PortTypeOperation_Output.xml | 8 ++++---- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/Utils/XPath.php b/src/Utils/XPath.php index dc375ec..d03911e 100644 --- a/src/Utils/XPath.php +++ b/src/Utils/XPath.php @@ -4,8 +4,7 @@ namespace SimpleSAML\WSDL\Utils; -use DOMNode; -use DOMXPath; +use Dom; use SimpleSAML\WSDL\Constants as C; use SimpleSAML\XPath\XPath as XPathUtils; @@ -17,15 +16,15 @@ class XPath extends XPathUtils { /** - * Get a DOMXPath object that can be used to search for XMLDSIG elements. + * Get a Dom\XPath object that can be used to search for XMLDSIG elements. * - * @param \DOMNode $node The document to associate to the DOMXPath object. + * @param \Dom\Node $node The document to associate to the Dom\XPath object. * @param bool $autoregister Whether to auto-register all namespaces used in the document * - * @return \DOMXPath A DOMXPath object ready to use in the given document, with the XMLDSIG namespace already + * @return \Dom\XPath A Dom\XPath object ready to use in the given document, with the XMLDSIG namespace already * registered. */ - public static function getXPath(DOMNode $node, bool $autoregister = false): DOMXPath + public static function getXPath(Dom\Node $node, bool $autoregister = false): Dom\XPath { $xp = parent::getXPath($node, $autoregister); diff --git a/tests/resources/xml/wsdl/PortTypeOperation_Input.xml b/tests/resources/xml/wsdl/PortTypeOperation_Input.xml index dba2608..40e29eb 100644 --- a/tests/resources/xml/wsdl/PortTypeOperation_Input.xml +++ b/tests/resources/xml/wsdl/PortTypeOperation_Input.xml @@ -1,5 +1,5 @@ - - - - + + + + diff --git a/tests/resources/xml/wsdl/PortTypeOperation_Output.xml b/tests/resources/xml/wsdl/PortTypeOperation_Output.xml index 651b1f5..058211d 100644 --- a/tests/resources/xml/wsdl/PortTypeOperation_Output.xml +++ b/tests/resources/xml/wsdl/PortTypeOperation_Output.xml @@ -1,5 +1,5 @@ - - - - + + + +