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

@@ 778-791 (lines=14) @@
775
     * @param XMLSecurityKey $key       The decryption key.
776
     * @param array          $blacklist Blacklisted decryption algorithms.
777
     */
778
    public function decryptNameId(XMLSecurityKey $key, array $blacklist = array())
779
    {
780
        if ($this->encryptedNameId === null) {
781
            /* No NameID to decrypt. */
782
783
            return;
784
        }
785
786
        $nameId = Utils::decryptElement($this->encryptedNameId, $key, $blacklist);
787
        Utils::getContainer()->debugMessage($nameId, 'decrypt');
788
        $this->nameId = Utils::parseNameId($nameId);
789
790
        $this->encryptedNameId = null;
791
    }
792
793
    /**
794
     * Did this Assertion contain encrypted Attributes?