Skip to content

Commit 7e6ce97

Browse files
authored
Use preffered way to pass nullable items
1 parent 14638b0 commit 7e6ce97

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/XML/xenc/EncryptedData.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
use SimpleSAML\XMLSecurity\XML\xenc\CipherData;
1414
use SimpleSAML\XMLSecurity\XML\xenc\EncryptionMethod;
1515

16+
use function array_pop;
17+
1618
/**
1719
* Class containing encrypted data.
1820
*
@@ -73,8 +75,8 @@ final public static function fromXML(DOMElement $xml): static
7375
self::getOptionalAttribute($xml, 'Type', null),
7476
self::getOptionalAttribute($xml, 'MimeType', null),
7577
self::getOptionalAttribute($xml, 'Encoding', null),
76-
count($encryptionMethod) === 1 ? $encryptionMethod[0] : null,
77-
count($keyInfo) === 1 ? $keyInfo[0] : null,
78+
array_pop($encryptionMethod[0]),
79+
array_pop($keyInfo[0]),
7880
);
7981
}
8082
}

0 commit comments

Comments
 (0)