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
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
"ext-spl": "*",

"simplesamlphp/assert": "~2.0",
"simplesamlphp/xml-common": "~2.8",
"simplesamlphp/xml-wss-core": "~1.4"
"simplesamlphp/xml-common": "dev-feature/dom-migration-php84",
"simplesamlphp/xml-wss-core": "dev-feature/dom-migration-php84"
},
"require-dev": {
"simplesamlphp/simplesamlphp-test-framework": "~1.11",
"simplesamlphp/xml-ws-addressing": "~1.3"
"simplesamlphp/xml-ws-addressing": "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\Policy\Utils;

use DOMNode;
use DOMXPath;
use Dom;
use SimpleSAML\WebServices\Policy\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 Security elements.
* Get a Dom\XPath object that can be used to search for WS Security 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
10 changes: 5 additions & 5 deletions src/XML/wsp_200409/AbstractOperatorContentType.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace SimpleSAML\WebServices\Policy\XML\wsp_200409;

use DOMElement;
use Dom;
use InvalidArgumentException;
use SimpleSAML\WebServices\Policy\Assert\Assert;
use SimpleSAML\XML\Constants as C;
Expand Down Expand Up @@ -93,12 +93,12 @@ public function isEmptyElement(): bool
/*
* Convert XML into an wsp:OperatorContentType 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 @@ -118,9 +118,9 @@ public static function fromXML(DOMElement $xml): static
/**
* Convert this wsp:OperatorContentType to XML.
*
* @param \DOMElement|null $parent The element we should add this wsp:OperatorContentType to.
* @param \Dom\Element|null $parent The element we should add this wsp:OperatorContentType 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/wsp_200409/AppliesTo.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace SimpleSAML\WebServices\Policy\XML\wsp_200409;

use DOMElement;
use Dom;
use SimpleSAML\WebServices\Policy\Assert\Assert;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\ExtendableElementTrait;
Expand Down Expand Up @@ -57,12 +57,12 @@ public function isEmptyElement(): bool
/*
* Convert XML into an wsp:AppliesTo 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, 'AppliesTo', InvalidDOMElementException::class);
Assert::same($xml->namespaceURI, AppliesTo::NS, InvalidDOMElementException::class);
Expand All @@ -77,9 +77,9 @@ public static function fromXML(DOMElement $xml): static
/**
* Convert this wsp:AppliesTo to XML.
*
* @param \DOMElement|null $parent The element we should add this wsp:AppliesTo to.
* @param \Dom\Element|null $parent The element we should add this wsp:AppliesTo 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/wsp_200409/Policy.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace SimpleSAML\WebServices\Policy\XML\wsp_200409;

use DOMElement;
use Dom;
use SimpleSAML\WebServices\Policy\Assert\Assert;
use SimpleSAML\WebServices\Policy\Constants as C;
use SimpleSAML\WebServices\Security\Type\IDValue;
Expand Down Expand Up @@ -99,13 +99,13 @@ final public function isEmptyElement(): bool
/*
* Convert XML into an wsp:Policy 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
*/
#[\Override]
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 Down Expand Up @@ -133,9 +133,9 @@ public static function fromXML(DOMElement $xml): static
/**
* Convert this wsp:Policy to XML.
*
* @param \DOMElement|null $parent The element we should add this wsp:Policy to
* @param \Dom\Element|null $parent The element we should add this wsp:Policy to
*/
public function toXML(?DOMElement $parent = null): DOMElement
public function toXML(?Dom\Element $parent = null): Dom\Element
{
$e = parent::toXML($parent);

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

namespace SimpleSAML\WebServices\Policy\XML\wsp_200409;

use DOMElement;
use Dom;
use SimpleSAML\WebServices\Policy\Assert\Assert;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\ExtendableElementTrait;
Expand Down Expand Up @@ -93,12 +93,12 @@ public function getPolicies(): array
/*
* Convert XML into an wsp:PolicyAttachment 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 @@ -125,9 +125,9 @@ public static function fromXML(DOMElement $xml): static
/**
* Convert this wsp:PolicyAttachment to XML.
*
* @param \DOMElement|null $parent The element we should add this wsp:AppliesTo to.
* @param \Dom\Element|null $parent The element we should add this wsp:AppliesTo 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/wsp_200409/PolicyReference.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace SimpleSAML\WebServices\Policy\XML\wsp_200409;

use DOMElement;
use Dom;
use SimpleSAML\WebServices\Policy\Assert\Assert;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\SchemaValidatableElementInterface;
Expand Down Expand Up @@ -84,12 +84,12 @@ public function getDigestAlgorithm(): ?AnyURIValue
/*
* Convert XML into an wsp:PolicyReference 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 @@ -106,9 +106,9 @@ public static function fromXML(DOMElement $xml): static
/**
* Convert this wsp:PolicyReference to XML.
*
* @param \DOMElement|null $parent The element we should add this wsp:Policy to
* @param \Dom\Element|null $parent The element we should add this wsp:Policy to
*/
public function toXML(?DOMElement $parent = null): DOMElement
public function toXML(?Dom\Element $parent = null): Dom\Element
{
$e = $this->instantiateParentElement($parent);
$e->setAttribute('URI', $this->getURI()->getValue());
Expand Down
10 changes: 5 additions & 5 deletions src/XML/wsp_200607/AbstractOperatorContentType.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace SimpleSAML\WebServices\Policy\XML\wsp_200607;

use DOMElement;
use Dom;
use InvalidArgumentException;
use SimpleSAML\WebServices\Policy\Assert\Assert;
use SimpleSAML\XML\Constants as C;
Expand Down Expand Up @@ -95,12 +95,12 @@ public function isEmptyElement(): bool
/*
* Convert XML into an wsp:OperatorContentType 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 @@ -120,9 +120,9 @@ public static function fromXML(DOMElement $xml): static
/**
* Convert this wsp:OperatorContentType to XML.
*
* @param \DOMElement|null $parent The element we should add this wsp:OperatorContentType to.
* @param \Dom\Element|null $parent The element we should add this wsp:OperatorContentType 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/wsp_200607/AbstractURI.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace SimpleSAML\WebServices\Policy\XML\wsp_200607;

use DOMElement;
use Dom\Element;
use SimpleSAML\WebServices\Policy\Assert\Assert;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\TypedTextContentTrait;
Expand Down Expand Up @@ -49,12 +49,12 @@ public function __construct(
/**
* Convert XML into an wsp:URI type 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 @@ -69,9 +69,9 @@ public static function fromXML(DOMElement $xml): static
/**
* Convert this wsp:URI type to XML.
*
* @param \DOMElement|null $parent The element we should add this wsp:URI to.
* @param \Dom\Element|null $parent The element we should add this wsp:URI 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/wsp_200607/AppliesTo.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace SimpleSAML\WebServices\Policy\XML\wsp_200607;

use DOMElement;
use Dom;
use SimpleSAML\WebServices\Policy\Assert\Assert;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\ExtendableElementTrait;
Expand Down Expand Up @@ -57,12 +57,12 @@ public function isEmptyElement(): bool
/*
* Convert XML into an wsp:AppliesTo 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, 'AppliesTo', InvalidDOMElementException::class);
Assert::same($xml->namespaceURI, AppliesTo::NS, InvalidDOMElementException::class);
Expand All @@ -77,9 +77,9 @@ public static function fromXML(DOMElement $xml): static
/**
* Convert this wsp:AppliesTo to XML.
*
* @param \DOMElement|null $parent The element we should add this wsp:AppliesTo to.
* @param \Dom\Element|null $parent The element we should add this wsp:AppliesTo 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/wsp_200607/Policy.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace SimpleSAML\WebServices\Policy\XML\wsp_200607;

use DOMElement;
use Dom;
use SimpleSAML\WebServices\Policy\Assert\Assert;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\SchemaValidatableElementInterface;
Expand Down Expand Up @@ -90,13 +90,13 @@ final public function isEmptyElement(): bool
/*
* Convert XML into an wsp:Policy 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
*/
#[\Override]
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 @@ -118,9 +118,9 @@ public static function fromXML(DOMElement $xml): static
/**
* Convert this wsp:Policy to XML.
*
* @param \DOMElement|null $parent The element we should add this wsp:Policy to
* @param \Dom\Element|null $parent The element we should add this wsp:Policy to
*/
public function toXML(?DOMElement $parent = null): DOMElement
public function toXML(?Dom\Element $parent = null): Dom\Element
{
$e = parent::toXML($parent);

Expand Down
Loading
Loading