Code Duplication    Length = 13-14 lines in 3 locations

src/SAML2/AuthnRequest.php 1 location

@@ 637-649 (lines=13) @@
634
     * @param XMLSecurityKey $key       The decryption key.
635
     * @param array          $blacklist Blacklisted decryption algorithms.
636
     */
637
    public function decryptNameId(XMLSecurityKey $key, array $blacklist = array())
638
    {
639
        if ($this->encryptedNameId === null) {
640
            /* No NameID to decrypt. */
641
            return;
642
        }
643
644
        $nameId = Utils::decryptElement($this->encryptedNameId, $key, $blacklist);
645
        Utils::getContainer()->debugMessage($nameId, 'decrypt');
646
        $this->nameId = Utils::parseNameId($nameId);
647
648
        $this->encryptedNameId = null;
649
    }
650
651
    /**
652
     * Retrieve the SubjectConfirmation elements we have in our Subject element.

src/SAML2/LogoutRequest.php 1 location

@@ 156-169 (lines=14) @@
153
     * @param XMLSecurityKey $key       The decryption key.
154
     * @param array          $blacklist Blacklisted decryption algorithms.
155
     */
156
    public function decryptNameId(XMLSecurityKey $key, array $blacklist = array())
157
    {
158
        if ($this->encryptedNameId === null) {
159
            /* No NameID to decrypt. */
160
161
            return;
162
        }
163
164
        $nameId = Utils::decryptElement($this->encryptedNameId, $key, $blacklist);
165
        Utils::getContainer()->debugMessage($nameId, 'decrypt');
166
        $this->nameId = Utils::parseNameId($nameId);
167
168
        $this->encryptedNameId = null;
169
    }
170
171
    /**
172
     * Retrieve the name identifier of the session that should be terminated.

src/SAML2/Assertion.php 1 location

@@ 713-726 (lines=14) @@
710
     * @param XMLSecurityKey $key       The decryption key.
711
     * @param array          $blacklist Blacklisted decryption algorithms.
712
     */
713
    public function decryptNameId(XMLSecurityKey $key, array $blacklist = array())
714
    {
715
        if ($this->encryptedNameId === null) {
716
            /* No NameID to decrypt. */
717
718
            return;
719
        }
720
721
        $nameId = Utils::decryptElement($this->encryptedNameId, $key, $blacklist);
722
        Utils::getContainer()->debugMessage($nameId, 'decrypt');
723
        $this->nameId = Utils::parseNameId($nameId);
724
725
        $this->encryptedNameId = null;
726
    }
727
728
    /**
729
     * Did this Assertion contain encrypted Attributes?