Skip to content

Commit bf6339b

Browse files
committed
Psalm-fixes
1 parent 75fa5a5 commit bf6339b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/XMLSecEnc.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,16 +147,20 @@ public function encryptNode(XMLSecurityKey $objKey, bool $replace = true)
147147
if (empty($this->rawNode)) {
148148
throw new Exception('Node to encrypt has not been set');
149149
}
150+
150151
if (!($objKey instanceof XMLSecurityKey)) {
151152
throw new Exception('Invalid Key');
152153
}
154+
153155
$doc = $this->rawNode->ownerDocument;
154156
$xPath = new DOMXPath($this->encdoc);
155157
$objList = $xPath->query('/xenc:EncryptedData/xenc:CipherData/xenc:CipherValue');
158+
156159
$cipherValue = $objList->item(0);
157160
if ($cipherValue == null) {
158161
throw new Exception('Error locating CipherValue element within template');
159162
}
163+
160164
switch ($this->type) {
161165
case (self::ELEMENT):
162166
$data = $doc->saveXML($this->rawNode);

0 commit comments

Comments
 (0)