Code Duplication    Length = 13-14 lines in 3 locations

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?

src/SAML2/AuthnRequest.php 1 location

@@ 652-664 (lines=13) @@
649
     * @param XMLSecurityKey $key       The decryption key.
650
     * @param array          $blacklist Blacklisted decryption algorithms.
651
     */
652
    public function decryptNameId(XMLSecurityKey $key, array $blacklist = array())
653
    {
654
        if ($this->encryptedNameId === null) {
655
            /* No NameID to decrypt. */
656
            return;
657
        }
658
659
        $nameId = Utils::decryptElement($this->encryptedNameId, $key, $blacklist);
660
        Utils::getContainer()->debugMessage($nameId, 'decrypt');
661
        $this->nameId = Utils::parseNameId($nameId);
662
663
        $this->encryptedNameId = null;
664
    }
665
666
    /**
667
     * Retrieve the SubjectConfirmation elements we have in our Subject element.