From 0ee940fe0ad84c0b19bffd0dc11500229735d0e6 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 3 Dec 2024 23:04:52 +0100 Subject: [PATCH] Add ds:SPKIData element --- src/XML/ds/AbstractSPKIDataType.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/XML/ds/AbstractSPKIDataType.php b/src/XML/ds/AbstractSPKIDataType.php index 23697c55..46d3d0da 100644 --- a/src/XML/ds/AbstractSPKIDataType.php +++ b/src/XML/ds/AbstractSPKIDataType.php @@ -23,7 +23,7 @@ abstract class AbstractSPKIDataType extends AbstractDsElement /** * Initialize a SPKIData element. * - * @param array<\SimpleSAML\XMLSecurity\XML\ds\SPKISexp, \SimpleSAML\XML\SerializableElementInterface|null> $tuples + * @param array{array{\SimpleSAML\XMLSecurity\XML\ds\SPKISexp, \SimpleSAML\XML\SerializableElementInterface|null}} $tuples */ final public function __construct( protected array $tuples, @@ -32,9 +32,8 @@ final public function __construct( Assert::allCount($tuples, 2); foreach ($tuples as $tuple) { - list($spkisExp, $other) = $tuple; - Assert::isInstanceOf($spkisExp, SPKISexp::class, SchemaViolationException::class); - Assert::nullOrIsInstanceOf($other, SerializableElementInterface::class, SchemaViolationException::class); + Assert::isInstanceOf($tuple[0], SPKISexp::class, SchemaViolationException::class); + Assert::nullOrIsInstanceOf($tuple[1], SerializableElementInterface::class, SchemaViolationException::class); } } @@ -42,7 +41,7 @@ final public function __construct( /** * Collect the value of the SPKISexp-property * - * @return array<\SimpleSAML\XMLSecurity\XML\ds\SPKISexp, \SimpleSAML\XML\SerializableElementInterface|null> + * @return array{array{\SimpleSAML\XMLSecurity\XML\ds\SPKISexp, \SimpleSAML\XML\SerializableElementInterface|null}} */ public function getTuples(): array { @@ -102,10 +101,8 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = $this->instantiateParentElement($parent); foreach ($this->getTuples() as $tuple) { - list($spkisExp, $other) = $tuple; - - $spkisExp->toXML($e); - $other?->toXML($e); + $tuple[0]->toXML($e); + $tuple[1]?->toXML($e); } return $e;