Code Duplication    Length = 7-8 lines in 2 locations

src/SAML2/Utils.php 2 locations

@@ 417-424 (lines=8) @@
414
            }
415
416
            /* Make sure that the input key format is the same as the one used to encrypt the key. */
417
            if ($inputKeyAlgo !== $symKeyInfoAlgo) {
418
                throw new Exception(
419
                    'Algorithm mismatch between input key and key used to encrypt ' .
420
                    ' the symmetric key for the message. Key was: ' .
421
                    var_export($inputKeyAlgo, TRUE) . '; message was: ' .
422
                    var_export($symKeyInfoAlgo, TRUE)
423
                );
424
            }
425
426
            /** @var XMLSecEnc $encKey */
427
            $encKey = $symmetricKeyInfo->encryptedCtx;
@@ 471-477 (lines=7) @@
468
        } else {
469
            $symKeyAlgo = $symmetricKey->getAlgorith();
470
            /* Make sure that the input key has the correct format. */
471
            if ($inputKeyAlgo !== $symKeyAlgo) {
472
                throw new Exception(
473
                    'Algorithm mismatch between input key and key in message. ' .
474
                    'Key was: ' . var_export($inputKeyAlgo, TRUE) . '; message was: ' .
475
                    var_export($symKeyAlgo, TRUE)
476
                );
477
            }
478
            $symmetricKey = $inputKey;
479
        }
480