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
14 changes: 8 additions & 6 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
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\WSDL\Utils;

use DOMNode;
use DOMXPath;
use Dom;
use SimpleSAML\WSDL\Constants as C;
use SimpleSAML\XPath\XPath as XPathUtils;

Expand All @@ -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);

Expand Down
12 changes: 6 additions & 6 deletions src/XML/soap12/AbstractAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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());
Expand Down
12 changes: 6 additions & 6 deletions src/XML/soap12/AbstractBinding.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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);

Expand Down
8 changes: 4 additions & 4 deletions src/XML/soap12/AbstractBody.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down
12 changes: 6 additions & 6 deletions src/XML/soap12/AbstractFault.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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);
}
Expand Down
32 changes: 22 additions & 10 deletions src/XML/soap12/AbstractHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

namespace SimpleSAML\WSDL\XML\soap12;

use DOMElement;
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;
Expand All @@ -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';

Expand Down Expand Up @@ -102,19 +104,19 @@ 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);

$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(
Expand All @@ -132,13 +134,23 @@ 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);

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());
Expand Down
24 changes: 18 additions & 6 deletions src/XML/soap12/AbstractHeaderFault.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

namespace SimpleSAML\WSDL\XML\soap12;

use DOMElement;
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;
Expand Down Expand Up @@ -73,12 +75,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);
Expand All @@ -96,13 +98,23 @@ 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);

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());
Expand Down
12 changes: 6 additions & 6 deletions src/XML/soap12/AbstractOperation.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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);

Expand Down
Loading
Loading