diff --git a/src/XML/ds/AbstractDSAKeyValueType.php b/src/XML/ds/AbstractDSAKeyValueType.php index 906195c3..7bb98f07 100644 --- a/src/XML/ds/AbstractDSAKeyValueType.php +++ b/src/XML/ds/AbstractDSAKeyValueType.php @@ -13,7 +13,7 @@ use SimpleSAML\XMLSchema\Exception\SchemaViolationException; use SimpleSAML\XMLSchema\Exception\TooManyElementsException; -use function array_pop; +use function array_last; /** * A class implementing the ds:AbstractDSAKeyValueType element. @@ -177,13 +177,13 @@ public static function fromXML(DOMElement $xml): static Assert::maxCount($pgenCounter, 1, TooManyElementsException::class); return new static( - array_pop($y), - array_pop($g), - array_pop($j), - array_pop($p), - array_pop($q), - array_pop($seed), - array_pop($pgenCounter), + array_last($y), + array_last($g), + array_last($j), + array_last($p), + array_last($q), + array_last($seed), + array_last($pgenCounter), ); } diff --git a/src/XML/ds/AbstractPGPDataType.php b/src/XML/ds/AbstractPGPDataType.php index a8ab76f0..5a7cc9cb 100644 --- a/src/XML/ds/AbstractPGPDataType.php +++ b/src/XML/ds/AbstractPGPDataType.php @@ -15,7 +15,7 @@ use SimpleSAML\XMLSchema\XML\Constants\NS; use SimpleSAML\XMLSecurity\XML\ds\AbstractDsElement; -use function array_pop; +use function array_last; /** * Abstract class representing the PGPDataType. @@ -95,8 +95,8 @@ public static function fromXML(DOMElement $xml): static Assert::maxCount($pgpKeyPacket, 1, TooManyElementsException::class); return new static( - array_pop($pgpKeyId), - array_pop($pgpKeyPacket), + array_last($pgpKeyId), + array_last($pgpKeyPacket), self::getChildElementsFromXML($xml), ); } diff --git a/src/XML/ds/KeyValue.php b/src/XML/ds/KeyValue.php index 8545613e..79cc3b47 100644 --- a/src/XML/ds/KeyValue.php +++ b/src/XML/ds/KeyValue.php @@ -18,8 +18,8 @@ use SimpleSAML\XMLSecurity\Constants as C; use SimpleSAML\XMLSecurity\XML\dsig11\ECKeyValue; +use function array_last; use function array_merge; -use function array_pop; /** * Class representing a ds:KeyValue element. @@ -107,7 +107,7 @@ public static function fromXML(DOMElement $xml): static TooManyElementsException::class, ); - return new static(array_pop($keyValue)); + return new static(array_last($keyValue)); } diff --git a/src/XML/ds/RSAKeyValue.php b/src/XML/ds/RSAKeyValue.php index d9abe06a..faba8d10 100644 --- a/src/XML/ds/RSAKeyValue.php +++ b/src/XML/ds/RSAKeyValue.php @@ -12,6 +12,8 @@ use SimpleSAML\XMLSchema\Exception\MissingElementException; use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use function array_last; + /** * Class representing a ds:RSAKeyValue element. * @@ -98,7 +100,7 @@ public static function fromXML(DOMElement $xml): static TooManyElementsException::class, ); - return new static(array_pop($modulus), array_pop($exponent)); + return new static(array_last($modulus), array_last($exponent)); } diff --git a/src/XML/ds/Reference.php b/src/XML/ds/Reference.php index 1b96060a..ab1fb927 100644 --- a/src/XML/ds/Reference.php +++ b/src/XML/ds/Reference.php @@ -14,7 +14,7 @@ use SimpleSAML\XMLSchema\Type\IDValue; use SimpleSAML\XMLSecurity\Assert\Assert; -use function array_pop; +use function array_last; use function strval; /** @@ -153,9 +153,9 @@ public static function fromXML(DOMElement $xml): static ); return new static( - array_pop($digestMethod), - array_pop($digestValue), - empty($transforms) ? null : array_pop($transforms), + array_last($digestMethod), + array_last($digestValue), + empty($transforms) ? null : array_last($transforms), $Id, $Type, $URI, diff --git a/src/XML/ds/RetrievalMethod.php b/src/XML/ds/RetrievalMethod.php index fb89479e..142147c8 100644 --- a/src/XML/ds/RetrievalMethod.php +++ b/src/XML/ds/RetrievalMethod.php @@ -12,6 +12,7 @@ use SimpleSAML\XMLSchema\Exception\TooManyElementsException; use SimpleSAML\XMLSchema\Type\AnyURIValue; +use function array_last; use function strval; /** @@ -91,7 +92,7 @@ public static function fromXML(DOMElement $xml): static ); return new static( - array_pop($transforms), + array_last($transforms), $URI, $Type, ); diff --git a/src/XML/ds/Signature.php b/src/XML/ds/Signature.php index 0c6f1f94..f3664e47 100644 --- a/src/XML/ds/Signature.php +++ b/src/XML/ds/Signature.php @@ -14,7 +14,7 @@ use SimpleSAML\XMLSecurity\Assert\Assert; use SimpleSAML\XMLSecurity\Constants as C; -use function array_pop; +use function array_last; use function strval; /** @@ -149,9 +149,9 @@ public static function fromXML(DOMElement $xml): static $objects = DsObject::getChildrenOfClass($xml); return new static( - array_pop($signedInfo), - array_pop($signatureValue), - empty($keyInfo) ? null : array_pop($keyInfo), + array_last($signedInfo), + array_last($signatureValue), + empty($keyInfo) ? null : array_last($keyInfo), $objects, self::getOptionalAttribute($xml, 'Id', IDValue::class, null), ); diff --git a/src/XML/ds/SignatureMethod.php b/src/XML/ds/SignatureMethod.php index 1b25ec7e..19a00adc 100644 --- a/src/XML/ds/SignatureMethod.php +++ b/src/XML/ds/SignatureMethod.php @@ -17,8 +17,8 @@ use SimpleSAML\XMLSecurity\Exception\InvalidArgumentException; use function array_keys; +use function array_last; use function array_merge; -use function array_pop; use function strval; /** @@ -102,7 +102,7 @@ public static function fromXML(DOMElement $xml): static $hmacOutputLength = HMACOutputLength::getChildrenOfClass($xml); Assert::maxCount($hmacOutputLength, 1, TooManyElementsException::class); - return new static($Algorithm, array_pop($hmacOutputLength), self::getChildElementsFromXML($xml)); + return new static($Algorithm, array_last($hmacOutputLength), self::getChildElementsFromXML($xml)); } diff --git a/src/XML/ds/SignedInfo.php b/src/XML/ds/SignedInfo.php index 5bb83d1a..e2e12c4b 100644 --- a/src/XML/ds/SignedInfo.php +++ b/src/XML/ds/SignedInfo.php @@ -17,7 +17,7 @@ use SimpleSAML\XMLSecurity\XML\CanonicalizableElementInterface; use SimpleSAML\XMLSecurity\XML\CanonicalizableElementTrait; -use function array_pop; +use function array_last; use function strval; /** @@ -162,8 +162,8 @@ public static function fromXML(DOMElement $xml): static ); $signedInfo = new static( - array_pop($canonicalizationMethod), - array_pop($signatureMethod), + array_last($canonicalizationMethod), + array_last($signatureMethod), $references, self::getOptionalAttribute($xml, 'Id', IDValue::class, null), ); diff --git a/src/XML/ds/Transform.php b/src/XML/ds/Transform.php index af11d5ed..4b8e5059 100644 --- a/src/XML/ds/Transform.php +++ b/src/XML/ds/Transform.php @@ -15,7 +15,7 @@ use SimpleSAML\XMLSecurity\XML\ec\InclusiveNamespaces; use SimpleSAML\XPath\Constants as XPATH_C; -use function array_pop; +use function array_last; use function strval; /** @@ -121,8 +121,8 @@ public static function fromXML(DOMElement $xml): static return new static( self::getAttribute($xml, 'Algorithm', AnyURIValue::class), - array_pop($xpath), - array_pop($prefixes), + array_last($xpath), + array_last($prefixes), ); } diff --git a/src/XML/ds/X509IssuerSerial.php b/src/XML/ds/X509IssuerSerial.php index 570ae234..8e12e0f0 100644 --- a/src/XML/ds/X509IssuerSerial.php +++ b/src/XML/ds/X509IssuerSerial.php @@ -10,7 +10,7 @@ use SimpleSAML\XMLSchema\Exception\MissingElementException; use SimpleSAML\XMLSchema\Exception\TooManyElementsException; -use function array_pop; +use function array_last; /** * Class representing a ds:X509IssuerSerial element. @@ -77,8 +77,8 @@ public static function fromXML(DOMElement $xml): static Assert::maxCount($serial, 1, TooManyElementsException::class); return new static( - array_pop($issuer), - array_pop($serial), + array_last($issuer), + array_last($serial), ); } diff --git a/src/XML/dsig11/Curve.php b/src/XML/dsig11/Curve.php index 196071fb..1099f860 100644 --- a/src/XML/dsig11/Curve.php +++ b/src/XML/dsig11/Curve.php @@ -10,7 +10,7 @@ use SimpleSAML\XMLSchema\Exception\MissingElementException; use SimpleSAML\XMLSchema\Exception\TooManyElementsException; -use function array_pop; +use function array_last; /** * Class representing a dsig11:Curve element. @@ -41,8 +41,8 @@ public static function fromXML(DOMElement $xml): static Assert::maxCount($b, 1, TooManyElementsException::class); return new static( - array_pop($a), - array_pop($b), + array_last($a), + array_last($b), ); } } diff --git a/src/XML/dsig11/ECKeyValue.php b/src/XML/dsig11/ECKeyValue.php index 151cea10..fb48b8fe 100644 --- a/src/XML/dsig11/ECKeyValue.php +++ b/src/XML/dsig11/ECKeyValue.php @@ -13,7 +13,7 @@ use SimpleSAML\XMLSchema\Exception\TooManyElementsException; use SimpleSAML\XMLSchema\Type\IDValue; -use function array_pop; +use function array_last; /** * Class representing a dsig11:ECKeyValue element. @@ -49,10 +49,10 @@ public static function fromXML(DOMElement $xml): static Assert::maxCount($namedCurve, 1, TooManyElementsException::class); return new static( - array_pop($publicKey), + array_last($publicKey), self::getOptionalAttribute($xml, 'Id', IDValue::class, null), - array_pop($ecParameters), - array_pop($namedCurve), + array_last($ecParameters), + array_last($namedCurve), ); } } diff --git a/src/XML/dsig11/ECParameters.php b/src/XML/dsig11/ECParameters.php index 817fe3c6..5e645972 100644 --- a/src/XML/dsig11/ECParameters.php +++ b/src/XML/dsig11/ECParameters.php @@ -10,7 +10,7 @@ use SimpleSAML\XMLSchema\Exception\MissingElementException; use SimpleSAML\XMLSchema\Exception\TooManyElementsException; -use function array_pop; +use function array_last; /** * Class representing a dsig11:ECParameters element. @@ -55,12 +55,12 @@ public static function fromXML(DOMElement $xml): static Assert::maxCount($validationData, 1, TooManyElementsException::class); return new static( - array_pop($fieldId), - array_pop($curve), - array_pop($base), - array_pop($order), - array_pop($coFactor), - array_pop($validationData), + array_last($fieldId), + array_last($curve), + array_last($base), + array_last($order), + array_last($coFactor), + array_last($validationData), ); } } diff --git a/src/XML/dsig11/FieldID.php b/src/XML/dsig11/FieldID.php index 7869a2f4..d03aab5d 100644 --- a/src/XML/dsig11/FieldID.php +++ b/src/XML/dsig11/FieldID.php @@ -11,6 +11,8 @@ use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use function array_last; + /** * Class representing a dsig11:FieldID element. * @@ -50,7 +52,7 @@ public static function fromXML(DOMElement $xml): static ); return new static( - array_pop($fieldId), + array_last($fieldId), ); } } diff --git a/src/XML/dsig11/GnB.php b/src/XML/dsig11/GnB.php index cc17338c..439ef211 100644 --- a/src/XML/dsig11/GnB.php +++ b/src/XML/dsig11/GnB.php @@ -12,7 +12,7 @@ use SimpleSAML\XMLSchema\Exception\MissingElementException; use SimpleSAML\XMLSchema\Exception\TooManyElementsException; -use function array_pop; +use function array_last; /** * Class representing a dsig11:GnB element. @@ -42,7 +42,7 @@ public static function fromXML(DOMElement $xml): static Assert::maxCount($m, 1, TooManyElementsException::class); return new static( - array_pop($m), + array_last($m), ); } } diff --git a/src/XML/dsig11/PnB.php b/src/XML/dsig11/PnB.php index eb0018e1..1062b263 100644 --- a/src/XML/dsig11/PnB.php +++ b/src/XML/dsig11/PnB.php @@ -12,7 +12,7 @@ use SimpleSAML\XMLSchema\Exception\MissingElementException; use SimpleSAML\XMLSchema\Exception\TooManyElementsException; -use function array_pop; +use function array_last; /** * Class representing a dsig11:PnB element. @@ -54,10 +54,10 @@ public static function fromXML(DOMElement $xml): static Assert::maxCount($m, 1, TooManyElementsException::class); return new static( - array_pop($m), - array_pop($k1), - array_pop($k2), - array_pop($k3), + array_last($m), + array_last($k1), + array_last($k2), + array_last($k3), ); } } diff --git a/src/XML/dsig11/Prime.php b/src/XML/dsig11/Prime.php index 179919f1..74dd1898 100644 --- a/src/XML/dsig11/Prime.php +++ b/src/XML/dsig11/Prime.php @@ -12,7 +12,7 @@ use SimpleSAML\XMLSchema\Exception\MissingElementException; use SimpleSAML\XMLSchema\Exception\TooManyElementsException; -use function array_pop; +use function array_last; /** * Class representing a dsig11:Prime element. @@ -42,7 +42,7 @@ public static function fromXML(DOMElement $xml): static Assert::maxCount($p, 1, TooManyElementsException::class); return new static( - array_pop($p), + array_last($p), ); } } diff --git a/src/XML/dsig11/TnB.php b/src/XML/dsig11/TnB.php index 42697dd1..d15acd2c 100644 --- a/src/XML/dsig11/TnB.php +++ b/src/XML/dsig11/TnB.php @@ -12,7 +12,7 @@ use SimpleSAML\XMLSchema\Exception\MissingElementException; use SimpleSAML\XMLSchema\Exception\TooManyElementsException; -use function array_pop; +use function array_last; /** * Class representing a dsig11:TnB element. @@ -46,8 +46,8 @@ public static function fromXML(DOMElement $xml): static Assert::maxCount($m, 1, TooManyElementsException::class); return new static( - array_pop($m), - array_pop($k), + array_last($m), + array_last($k), ); } } diff --git a/src/XML/dsig11/ValidationData.php b/src/XML/dsig11/ValidationData.php index 64e95615..39d65a72 100644 --- a/src/XML/dsig11/ValidationData.php +++ b/src/XML/dsig11/ValidationData.php @@ -13,7 +13,7 @@ use SimpleSAML\XMLSchema\Exception\TooManyElementsException; use SimpleSAML\XMLSchema\Type\AnyURIValue; -use function array_pop; +use function array_last; /** * Class representing a dsig11:ValidationData element. @@ -43,7 +43,7 @@ public static function fromXML(DOMElement $xml): static Assert::maxCount($seed, 1, TooManyElementsException::class); return new static( - array_pop($seed), + array_last($seed), self::getAttribute($xml, 'hashAlgorithm', AnyURIValue::class), ); } diff --git a/src/XML/xenc/AbstractAgreementMethodType.php b/src/XML/xenc/AbstractAgreementMethodType.php index 94180e46..c38f518e 100644 --- a/src/XML/xenc/AbstractAgreementMethodType.php +++ b/src/XML/xenc/AbstractAgreementMethodType.php @@ -14,7 +14,7 @@ use SimpleSAML\XMLSchema\Type\AnyURIValue; use SimpleSAML\XMLSchema\XML\Constants\NS; -use function array_pop; +use function array_last; use function strval; /** @@ -126,9 +126,9 @@ public static function fromXML(DOMElement $xml): static return new static( self::getAttribute($xml, 'Algorithm', AnyURIValue::class), - array_pop($kaNonce), - array_pop($originatorKeyInfo), - array_pop($recipientKeyInfo), + array_last($kaNonce), + array_last($originatorKeyInfo), + array_last($recipientKeyInfo), $children, ); } diff --git a/src/XML/xenc/AbstractDHKeyValueType.php b/src/XML/xenc/AbstractDHKeyValueType.php index cd92c669..e64958e3 100644 --- a/src/XML/xenc/AbstractDHKeyValueType.php +++ b/src/XML/xenc/AbstractDHKeyValueType.php @@ -13,7 +13,7 @@ use SimpleSAML\XMLSchema\Exception\SchemaViolationException; use SimpleSAML\XMLSchema\Exception\TooManyElementsException; -use function array_pop; +use function array_last; /** * A class implementing the xenc:AbstractDHKeyValueType element. @@ -160,12 +160,12 @@ public static function fromXML(DOMElement $xml): static Assert::maxCount($pgenCounter, 1, TooManyElementsException::class); return new static( - array_pop($xencPublic), - array_pop($p), - array_pop($q), - array_pop($generator), - array_pop($seed), - array_pop($pgenCounter), + array_last($xencPublic), + array_last($p), + array_last($q), + array_last($generator), + array_last($seed), + array_last($pgenCounter), ); } diff --git a/src/XML/xenc/AbstractEncryptionMethod.php b/src/XML/xenc/AbstractEncryptionMethod.php index f386ddae..3ec2ee7c 100644 --- a/src/XML/xenc/AbstractEncryptionMethod.php +++ b/src/XML/xenc/AbstractEncryptionMethod.php @@ -12,7 +12,7 @@ use SimpleSAML\XMLSchema\Type\AnyURIValue; use SimpleSAML\XMLSchema\XML\Constants\NS; -use function array_pop; +use function array_last; use function strval; /** @@ -105,8 +105,8 @@ public static function fromXML(DOMElement $xml): static return new static( self::getAttribute($xml, 'Algorithm', AnyURIValue::class), - array_pop($keySize), - array_pop($oaepParams), + array_last($keySize), + array_last($oaepParams), self::getChildElementsFromXML($xml), ); } diff --git a/src/XML/xenc/CipherData.php b/src/XML/xenc/CipherData.php index 82fa8209..ee743163 100644 --- a/src/XML/xenc/CipherData.php +++ b/src/XML/xenc/CipherData.php @@ -11,7 +11,7 @@ use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Exception\TooManyElementsException; -use function array_pop; +use function array_last; /** * Class representing . @@ -96,8 +96,8 @@ public static function fromXML(DOMElement $xml): static ); return new static( - empty($cv) ? null : array_pop($cv), - empty($cr) ? null : array_pop($cr), + empty($cv) ? null : array_last($cv), + empty($cr) ? null : array_last($cr), ); } diff --git a/src/XML/xenc/EncryptedData.php b/src/XML/xenc/EncryptedData.php index 332f74f0..79db019c 100644 --- a/src/XML/xenc/EncryptedData.php +++ b/src/XML/xenc/EncryptedData.php @@ -16,7 +16,7 @@ use SimpleSAML\XMLSchema\Type\StringValue; use SimpleSAML\XMLSecurity\XML\ds\KeyInfo; -use function array_pop; +use function array_last; /** * Class containing encrypted data. @@ -81,8 +81,8 @@ final public static function fromXML(DOMElement $xml): static self::getOptionalAttribute($xml, 'Type', AnyURIValue::class, null), self::getOptionalAttribute($xml, 'MimeType', StringValue::class, null), self::getOptionalAttribute($xml, 'Encoding', AnyURIValue::class, null), - array_pop($encryptionMethod), - array_pop($keyInfo), + array_last($encryptionMethod), + array_last($keyInfo), ); } } diff --git a/src/XML/xenc/EncryptedKey.php b/src/XML/xenc/EncryptedKey.php index cab59e46..36e76fa5 100644 --- a/src/XML/xenc/EncryptedKey.php +++ b/src/XML/xenc/EncryptedKey.php @@ -19,6 +19,7 @@ use SimpleSAML\XMLSecurity\Key\KeyInterface; use SimpleSAML\XMLSecurity\XML\ds\KeyInfo; +use function array_last; use function strval; /** @@ -250,10 +251,10 @@ public static function fromXML(DOMElement $xml): static self::getOptionalAttribute($xml, 'MimeType', StringValue::class, null), self::getOptionalAttribute($xml, 'Encoding', AnyURIValue::class, null), self::getOptionalAttribute($xml, 'Recipient', StringValue::class, null), - array_pop($carriedKeyNames), - array_pop($encryptionMethod), - array_pop($keyInfo), - array_pop($referenceLists), + array_last($carriedKeyNames), + array_last($encryptionMethod), + array_last($keyInfo), + array_last($referenceLists), ); } diff --git a/src/XML/xenc11/AbstractConcatKDFParamsType.php b/src/XML/xenc11/AbstractConcatKDFParamsType.php index 71d04f6d..c71148c8 100644 --- a/src/XML/xenc11/AbstractConcatKDFParamsType.php +++ b/src/XML/xenc11/AbstractConcatKDFParamsType.php @@ -14,7 +14,7 @@ use SimpleSAML\XMLSecurity\Assert\Assert; use SimpleSAML\XMLSecurity\XML\ds\DigestMethod; -use function array_pop; +use function array_last; use function strval; /** @@ -131,7 +131,7 @@ public static function fromXML(DOMElement $xml): static Assert::maxCount($digestMethod, 1, TooManyElementsException::class); return new static( - array_pop($digestMethod), + array_last($digestMethod), self::getOptionalAttribute($xml, 'AlgorithmID', HexBinaryValue::class, null), self::getOptionalAttribute($xml, 'PartyUInfo', HexBinaryValue::class, null), self::getOptionalAttribute($xml, 'PartyVInfo', HexBinaryValue::class, null), diff --git a/src/XML/xenc11/AbstractDerivedKeyType.php b/src/XML/xenc11/AbstractDerivedKeyType.php index da24ab1f..a286f336 100644 --- a/src/XML/xenc11/AbstractDerivedKeyType.php +++ b/src/XML/xenc11/AbstractDerivedKeyType.php @@ -15,7 +15,7 @@ use SimpleSAML\XMLSecurity\Assert\Assert; use SimpleSAML\XMLSecurity\XML\xenc\ReferenceList; -use function array_pop; +use function array_last; use function strval; /** @@ -171,10 +171,10 @@ public static function fromXML(DOMElement $xml): static self::getOptionalAttribute($xml, 'Recipient', StringValue::class, null), self::getOptionalAttribute($xml, 'Id', IDValue::class, null), self::getOptionalAttribute($xml, 'Type', AnyURIValue::class, null), - array_pop($keyDerivationMethod), - array_pop($referenceList), - array_pop($derivedKeyName), - array_pop($masterKeyName), + array_last($keyDerivationMethod), + array_last($referenceList), + array_last($derivedKeyName), + array_last($masterKeyName), ); } diff --git a/src/XML/xenc11/AbstractPBKDF2ParameterType.php b/src/XML/xenc11/AbstractPBKDF2ParameterType.php index 17507040..46b4f305 100644 --- a/src/XML/xenc11/AbstractPBKDF2ParameterType.php +++ b/src/XML/xenc11/AbstractPBKDF2ParameterType.php @@ -12,7 +12,7 @@ use SimpleSAML\XMLSchema\Exception\MissingElementException; use SimpleSAML\XMLSchema\Exception\TooManyElementsException; -use function array_pop; +use function array_last; /** * Class representing . @@ -113,10 +113,10 @@ public static function fromXML(DOMElement $xml): static Assert::maxCount($prf, 1, TooManyElementsException::class); return new static( - array_pop($salt), - array_pop($iterationCount), - array_pop($keyLength), - array_pop($prf), + array_last($salt), + array_last($iterationCount), + array_last($keyLength), + array_last($prf), ); } diff --git a/src/XML/xenc11/OtherSource.php b/src/XML/xenc11/OtherSource.php index 79152182..cfbb0c49 100644 --- a/src/XML/xenc11/OtherSource.php +++ b/src/XML/xenc11/OtherSource.php @@ -10,7 +10,7 @@ use SimpleSAML\XMLSchema\Exception\TooManyElementsException; use SimpleSAML\XMLSchema\Type\AnyURIValue; -use function array_pop; +use function array_last; /** * A class implementing the xenc11:OtherSource element. @@ -35,7 +35,7 @@ public static function fromXML(DOMElement $xml): static return new static( self::getAttribute($xml, 'Algorithm', AnyURIValue::class), - array_pop($parameter), + array_last($parameter), ); } } diff --git a/src/XML/xenc11/Salt.php b/src/XML/xenc11/Salt.php index 6bf94cef..52294d4d 100644 --- a/src/XML/xenc11/Salt.php +++ b/src/XML/xenc11/Salt.php @@ -10,8 +10,8 @@ use SimpleSAML\XMLSchema\Exception\MissingElementException; use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use function array_last; use function array_merge; -use function array_pop; /** * Class representing . @@ -60,7 +60,7 @@ public static function fromXML(DOMElement $xml): static Assert::minCount($content, 1, MissingElementException::class); Assert::maxCount($content, 1, TooManyElementsException::class); - return new static(array_pop($content)); + return new static(array_last($content)); }