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 = 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/AuthnRequest.php 1 location

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

src/SAML2/Assertion.php 1 location

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