Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
"ext-dom": "*",

"simplesamlphp/assert": "~2.0",
"simplesamlphp/xml-common": "~2.8",
"simplesamlphp/xml-ws-policy": "~1.3",
"simplesamlphp/xml-wss-core": "~1.4"
"simplesamlphp/xml-common": "dev-feature/dom-migration-php84",
"simplesamlphp/xml-ws-policy": "dev-feature/dom-migration-php84",
"simplesamlphp/xml-wss-core": "dev-feature/dom-migration-php84"
},
"require-dev": {
"simplesamlphp/simplesamlphp-test-framework": "~1.11",
"simplesamlphp/xml-soap": "~2.3"
"simplesamlphp/xml-soap": "dev-feature/dom-migration-php84"
},
"autoload": {
"psr-4": {
Expand Down
11 changes: 5 additions & 6 deletions src/Utils/XPath.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

namespace SimpleSAML\WebServices\Addressing\Utils;

use DOMNode;
use DOMXPath;
use Dom;
use SimpleSAML\WebServices\Addressing\Constants as C;

/**
Expand All @@ -16,15 +15,15 @@
class XPath extends \SimpleSAML\XPath\XPath
{
/*
* Get a DOMXPath object that can be used to search for WS-Addressing elements.
* Get a Dom\XPath object that can be used to search for WS-Addressing 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 several
* @return \Dom\XPath A Dom\XPath object ready to use in the given document, with several
* ws-related namespaces 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);

Expand Down
15 changes: 9 additions & 6 deletions src/XML/wsa_200408/AbstractAttributedQNameType.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace SimpleSAML\WebServices\Addressing\XML\wsa_200408;

use DOMElement;
use Dom;
use SimpleSAML\WebServices\Addressing\Assert\Assert;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\TypedTextContentTrait;
Expand Down Expand Up @@ -49,26 +49,29 @@ final public function __construct(QNameValue $value, array $namespacedAttributes
/**
* Convert XML into a class instance
*
* @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);

return new static(QNameValue::fromDocument($xml->textContent, $xml), self::getAttributesNSFromXML($xml));
return new static(
QNameValue::fromDocument((string)$xml->textContent, $xml),
self::getAttributesNSFromXML($xml),
);
}


/**
* Convert this element to XML.
*
* @param \DOMElement|null $parent The element we should append this element to.
* @param \Dom\Element|null $parent The element we should append this element to.
*/
public function toXML(?DOMElement $parent = null): DOMElement
public function toXML(?Dom\Element $parent = null): Dom\Element
{
$e = $this->instantiateParentElement($parent);
$e->textContent = $this->getContent()->getValue();
Expand Down
15 changes: 9 additions & 6 deletions src/XML/wsa_200408/AbstractAttributedURIType.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace SimpleSAML\WebServices\Addressing\XML\wsa_200408;

use DOMElement;
use Dom;
use SimpleSAML\WebServices\Addressing\Assert\Assert;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\TypedTextContentTrait;
Expand Down Expand Up @@ -49,26 +49,29 @@ final public function __construct(AnyURIValue $value, array $namespacedAttribute
/**
* Convert XML into a class instance
*
* @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);

return new static(AnyURIValue::fromString($xml->textContent), self::getAttributesNSFromXML($xml));
return new static(
AnyURIValue::fromString((string)$xml->textContent),
self::getAttributesNSFromXML($xml),
);
}


/**
* Convert this element to XML.
*
* @param \DOMElement|null $parent The element we should append this element to.
* @param \Dom\Element|null $parent The element we should append this element to.
*/
public function toXML(?DOMElement $parent = null): DOMElement
public function toXML(?Dom\Element $parent = null): Dom\Element
{
$e = $this->instantiateParentElement($parent);
$e->textContent = $this->getContent()->getValue();
Expand Down
10 changes: 5 additions & 5 deletions src/XML/wsa_200408/AbstractEndpointReferenceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace SimpleSAML\WebServices\Addressing\XML\wsa_200408;

use DOMElement;
use Dom;
use SimpleSAML\WebServices\Addressing\Assert\Assert;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\ExtendableElementTrait;
Expand Down Expand Up @@ -125,14 +125,14 @@ public function getServiceName(): ?ServiceName
*
* Note: this method cannot be used when extending this class, if the constructor has a different signature.
*
* @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
* @throws \SimpleSAML\XMLSchema\Exception\MissingAttributeException
* if the supplied element is missing any of the mandatory attributes
*/
public static function fromXML(DOMElement $xml): static
public static function fromXML(Dom\Element $xml): static
{
$qualifiedName = static::getClassName(static::class);
Assert::eq(
Expand Down Expand Up @@ -173,9 +173,9 @@ public static function fromXML(DOMElement $xml): static
/**
* Add this endpoint reference to an XML element.
*
* @param \DOMElement|null $parent The element we should append this endpoint to.
* @param \Dom\Element|null $parent The element we should append this endpoint to.
*/
public function toXML(?DOMElement $parent = null): DOMElement
public function toXML(?Dom\Element $parent = null): Dom\Element
{
$e = parent::instantiateParentElement($parent);

Expand Down
12 changes: 6 additions & 6 deletions src/XML/wsa_200408/AbstractRelationshipType.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace SimpleSAML\WebServices\Addressing\XML\wsa_200408;

use DOMElement;
use Dom;
use SimpleSAML\WebServices\Addressing\Assert\Assert;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\TypedTextContentTrait;
Expand Down Expand Up @@ -63,18 +63,18 @@ public function getRelationshipType(): ?QNameValue
/**
* Convert XML into a class instance
*
* @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);

return new static(
AnyURIValue::fromString($xml->textContent),
AnyURIValue::fromString((string)$xml->textContent),
self::getOptionalAttribute($xml, 'RelationshipType', QNameValue::class, null),
self::getAttributesNSFromXML($xml),
);
Expand All @@ -84,9 +84,9 @@ public static function fromXML(DOMElement $xml): static
/**
* Convert this element to XML.
*
* @param \DOMElement|null $parent The element we should append this element to.
* @param \Dom\Element|null $parent The element we should append this element to.
*/
public function toXML(?DOMElement $parent = null): DOMElement
public function toXML(?Dom\Element $parent = null): Dom\Element
{
$e = $this->instantiateParentElement($parent);
$e->textContent = $this->getContent()->getValue();
Expand Down
15 changes: 9 additions & 6 deletions src/XML/wsa_200408/AbstractRetryAfterType.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace SimpleSAML\WebServices\Addressing\XML\wsa_200408;

use DOMElement;
use Dom;
use SimpleSAML\WebServices\Addressing\Assert\Assert;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\TypedTextContentTrait;
Expand Down Expand Up @@ -51,26 +51,29 @@ final public function __construct(
/**
* Convert XML into a class instance
*
* @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);

return new static(NonNegativeIntegerValue::fromString($xml->textContent), self::getAttributesNSFromXML($xml));
return new static(
NonNegativeIntegerValue::fromString((string)$xml->textContent),
self::getAttributesNSFromXML($xml),
);
}


/**
* Convert this element to XML.
*
* @param \DOMElement|null $parent The element we should append this element to.
* @param \Dom\Element|null $parent The element we should append this element to.
*/
public function toXML(?DOMElement $parent = null): DOMElement
public function toXML(?Dom\Element $parent = null): Dom\Element
{
$e = $this->instantiateParentElement($parent);
$e->textContent = $this->getContent()->getValue();
Expand Down
12 changes: 6 additions & 6 deletions src/XML/wsa_200408/AbstractServiceNameType.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace SimpleSAML\WebServices\Addressing\XML\wsa_200408;

use DOMElement;
use Dom;
use SimpleSAML\WebServices\Addressing\Assert\Assert;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\TypedTextContentTrait;
Expand Down Expand Up @@ -63,18 +63,18 @@ public function getPortName(): ?NCNameValue
/**
* Convert XML into a class instance
*
* @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);

return new static(
QNameValue::fromDocument($xml->textContent, $xml),
QNameValue::fromDocument((string)$xml->textContent, $xml),
self::getOptionalAttribute($xml, 'PortName', NCNameValue::class, null),
self::getAttributesNSFromXML($xml),
);
Expand All @@ -84,9 +84,9 @@ public static function fromXML(DOMElement $xml): static
/**
* Convert this element to XML.
*
* @param \DOMElement|null $parent The element we should append this element to.
* @param \Dom\Element|null $parent The element we should append this element to.
*/
public function toXML(?DOMElement $parent = null): DOMElement
public function toXML(?Dom\Element $parent = null): Dom\Element
{
$e = $this->instantiateParentElement($parent);
$e->textContent = $this->getContent()->getValue();
Expand Down
10 changes: 5 additions & 5 deletions src/XML/wsa_200408/ReferenceParameters.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace SimpleSAML\WebServices\Addressing\XML\wsa_200408;

use DOMElement;
use Dom;
use SimpleSAML\WebServices\Addressing\Assert\Assert;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException;
Expand Down Expand Up @@ -47,12 +47,12 @@ public function isEmptyElement(): bool
/*
* Convert XML into an ReferenceParameters 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);
Expand All @@ -66,9 +66,9 @@ public static function fromXML(DOMElement $xml): static
/**
* Convert this ReferenceParameters to XML.
*
* @param \DOMElement|null $parent The element we should add this ReferenceParameters to.
* @param \Dom\Element|null $parent The element we should add this ReferenceParameters to.
*/
public function toXML(?DOMElement $parent = null): DOMElement
public function toXML(?Dom\Element $parent = null): Dom\Element
{
$e = $this->instantiateParentElement($parent);

Expand Down
10 changes: 5 additions & 5 deletions src/XML/wsa_200408/ReferenceProperties.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace SimpleSAML\WebServices\Addressing\XML\wsa_200408;

use DOMElement;
use Dom;
use SimpleSAML\WebServices\Addressing\Assert\Assert;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException;
Expand Down Expand Up @@ -47,12 +47,12 @@ public function isEmptyElement(): bool
/*
* Convert XML into an ReferenceProperties 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);
Expand All @@ -66,9 +66,9 @@ public static function fromXML(DOMElement $xml): static
/**
* Convert this ReferenceProperties to XML.
*
* @param \DOMElement|null $parent The element we should add this ReferenceProperties to.
* @param \Dom\Element|null $parent The element we should add this ReferenceProperties to.
*/
public function toXML(?DOMElement $parent = null): DOMElement
public function toXML(?Dom\Element $parent = null): Dom\Element
{
$e = $this->instantiateParentElement($parent);

Expand Down
Loading
Loading