Code Duplication    Length = 7-8 lines in 2 locations

src/SAML2/Utils.php 2 locations

@@ 428-435 (lines=8) @@
425
            }
426
427
            /* Make sure that the input key format is the same as the one used to encrypt the key. */
428
            if ($inputKeyAlgo !== $symKeyInfoAlgo) {
429
                throw new \Exception(
430
                    'Algorithm mismatch between input key and key used to encrypt ' .
431
                    ' the symmetric key for the message. Key was: ' .
432
                    var_export($inputKeyAlgo, true) . '; message was: ' .
433
                    var_export($symKeyInfoAlgo, true)
434
                );
435
            }
436
437
            /** @var XMLSecEnc $encKey */
438
            $encKey = $symmetricKeyInfo->encryptedCtx;
@@ 481-487 (lines=7) @@
478
        } else {
479
            $symKeyAlgo = $symmetricKey->getAlgorith();
480
            /* Make sure that the input key has the correct format. */
481
            if ($inputKeyAlgo !== $symKeyAlgo) {
482
                throw new \Exception(
483
                    'Algorithm mismatch between input key and key in message. ' .
484
                    'Key was: ' . var_export($inputKeyAlgo, true) . '; message was: ' .
485
                    var_export($symKeyAlgo, true)
486
                );
487
            }
488
            $symmetricKey = $inputKey;
489
        }
490