Code Duplication    Length = 13-14 lines in 3 locations

src/SAML2/AuthnRequest.php 1 location

@@ 648-660 (lines=13) @@
645
     * @param XMLSecurityKey $key       The decryption key.
646
     * @param array          $blacklist Blacklisted decryption algorithms.
647
     */
648
    public function decryptNameId(XMLSecurityKey $key, array $blacklist = array())
649
    {
650
        if ($this->encryptedNameId === null) {
651
            /* No NameID to decrypt. */
652
            return;
653
        }
654
655
        $nameId = Utils::decryptElement($this->encryptedNameId, $key, $blacklist);
656
        Utils::getContainer()->debugMessage($nameId, 'decrypt');
657
        $this->nameId = new XML\saml\NameID($nameId);
658
659
        $this->encryptedNameId = null;
660
    }
661
662
    /**
663
     * 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 = new XML\saml\NameID($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

@@ 802-815 (lines=14) @@
799
     * @param XMLSecurityKey $key       The decryption key.
800
     * @param array          $blacklist Blacklisted decryption algorithms.
801
     */
802
    public function decryptNameId(XMLSecurityKey $key, array $blacklist = array())
803
    {
804
        if ($this->encryptedNameId === null) {
805
            /* No NameID to decrypt. */
806
807
            return;
808
        }
809
810
        $nameId = Utils::decryptElement($this->encryptedNameId, $key, $blacklist);
811
        Utils::getContainer()->debugMessage($nameId, 'decrypt');
812
        $this->nameId = new XML\saml\NameID($nameId);
813
814
        $this->encryptedNameId = null;
815
    }
816
817
    /**
818
     * Did this Assertion contain encrypted Attributes?