Skip to content
Merged
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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"ext-pcre": "*",

"simplesamlphp/assert": "~2.0",
"simplesamlphp/xml-common": "dev-feature/dom-migration-php84"
"simplesamlphp/xml-common": "~2.0"
},
"require-dev": {
"simplesamlphp/simplesamlphp-test-framework": "~1.11"
Expand Down
4 changes: 2 additions & 2 deletions src/SOAP11/XML/Body.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

use function array_diff;
use function array_filter;
use function array_pop;
use function array_last;
use function array_values;

/**
Expand Down Expand Up @@ -61,7 +61,7 @@ public function __construct(array $children = [], array $namespacedAttributes =
}));
Assert::maxCount($fault, 1, ProtocolViolationException::class);

$this->setFault(array_pop($fault));
$this->setFault(array_last($fault));
$this->setElements(array_diff($children, $fault));
$this->setAttributesNS($namespacedAttributes);
}
Expand Down
6 changes: 4 additions & 2 deletions src/SOAP11/XML/Envelope.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
use SimpleSAML\XMLSchema\Exception\TooManyElementsException;
use SimpleSAML\XMLSchema\XML\Constants\NS;

use function array_last;

/**
* Class representing a SOAP-ENV:Envelope element.
*
Expand Down Expand Up @@ -91,8 +93,8 @@ public static function fromXML(DOMElement $xml): static
Assert::maxCount($header, 1, 'Cannot process more than one Header element.', TooManyElementsException::class);

return new static(
array_pop($body),
empty($header) ? null : array_pop($header),
array_last($body),
array_last($header),
self::getChildElementsFromXML($xml),
self::getAttributesNSFromXML($xml),
);
Expand Down
10 changes: 6 additions & 4 deletions src/SOAP11/XML/Fault.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
use SimpleSAML\XMLSchema\Exception\MissingElementException;
use SimpleSAML\XMLSchema\Exception\TooManyElementsException;

use function array_last;

/**
* Class representing a SOAP-ENV:Fault element.
*
Expand Down Expand Up @@ -106,10 +108,10 @@ public static function fromXML(DOMElement $xml): static
Assert::maxCount($detail, 1, 'Cannot process more than one detail element.', TooManyElementsException::class);

return new self(
array_pop($faultCode),
array_pop($faultString),
array_pop($faultActor),
array_pop($detail),
array_last($faultCode),
array_last($faultString),
array_last($faultActor),
array_last($detail),
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/SOAP12/XML/Body.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException;
use SimpleSAML\XMLSchema\XML\Constants\NS;

use function array_pop;
use function array_last;

/**
* Class representing a env:Body element.
Expand Down Expand Up @@ -104,7 +104,7 @@ public static function fromXML(DOMElement $xml): static
Assert::maxCount($fault, 1, ProtocolViolationException::class);

return new static(
array_pop($fault),
array_last($fault),
self::getChildElementsFromXML($xml),
self::getAttributesNSFromXML($xml),
);
Expand Down
4 changes: 2 additions & 2 deletions src/SOAP12/XML/Code.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ public static function fromXML(DOMElement $xml): static
Assert::maxCount($subcode, 1, 'Cannot process more than one Subcode element.', TooManyElementsException::class);

return new static(
array_pop($value),
empty($subcode) ? null : array_pop($subcode),
array_last($value),
array_last($subcode),
);
}

Expand Down
6 changes: 4 additions & 2 deletions src/SOAP12/XML/Envelope.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
use SimpleSAML\XMLSchema\Exception\TooManyElementsException;
use SimpleSAML\XMLSchema\XML\Constants\NS;

use function array_last;

/**
* Class representing a env:Envelope element.
*
Expand Down Expand Up @@ -83,8 +85,8 @@ public static function fromXML(DOMElement $xml): static
Assert::maxCount($header, 1, 'Cannot process more than one Header element.', TooManyElementsException::class);

return new static(
array_pop($body),
empty($header) ? null : array_pop($header),
array_last($body),
array_last($header),
self::getAttributesNSFromXML($xml),
);
}
Expand Down
12 changes: 7 additions & 5 deletions src/SOAP12/XML/Fault.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
use SimpleSAML\XMLSchema\Exception\MissingElementException;
use SimpleSAML\XMLSchema\Exception\TooManyElementsException;

use function array_last;

/**
* Class representing a env:Fault element.
*
Expand Down Expand Up @@ -116,11 +118,11 @@ public static function fromXML(DOMElement $xml): static
Assert::maxCount($detail, 1, 'Cannot process more than one Detail element.', TooManyElementsException::class);

return new self(
array_pop($code),
array_pop($reason),
empty($node) ? null : array_pop($node),
empty($role) ? null : array_pop($role),
empty($detail) ? null : array_pop($detail),
array_last($code),
array_last($reason),
array_last($node),
array_last($role),
array_last($detail),
);
}

Expand Down
6 changes: 4 additions & 2 deletions src/SOAP12/XML/Subcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
use SimpleSAML\XMLSchema\Exception\MissingElementException;
use SimpleSAML\XMLSchema\Exception\TooManyElementsException;

use function array_last;

/**
* Class representing a env:Subcode element.
*
Expand Down Expand Up @@ -68,8 +70,8 @@ public static function fromXML(DOMElement $xml): static
Assert::maxCount($subcode, 1, 'Cannot process more than one Subcode element.', TooManyElementsException::class);

return new static(
array_pop($value),
empty($subcode) ? null : array_pop($subcode),
array_last($value),
array_last($subcode),
);
}

Expand Down