Code Duplication    Length = 9-9 lines in 4 locations

src/SAML2/AuthnRequest.php 1 location

@@ 601-609 (lines=9) @@
598
     *
599
     * @param \SAML2\XML\saml\NameID|null $nameId The name identifier of the assertion.
600
     */
601
    public function setNameId($nameId)
602
    {
603
        assert(is_array($nameId) || is_null($nameId) || is_a($nameId, "\SAML2\XML\saml\NameID"));
604
605
        if (is_array($nameId)) {
606
            $nameId = XML\saml\NameID::fromArray($nameId);
607
        }
608
        $this->nameId = $nameId;
609
    }
610
611
    /**
612
     * Encrypt the NameID in the AuthnRequest.

src/SAML2/LogoutRequest.php 1 location

@@ 191-199 (lines=9) @@
188
     *
189
     * @param \SAML2\XML\saml\NameID|array|null $nameId The name identifier of the session that should be terminated.
190
     */
191
    public function setNameId($nameId)
192
    {
193
        assert(is_array($nameId) || is_a($nameId, "\SAML2\XML\saml\NameID"));
194
195
        if (is_array($nameId)) {
196
            $nameId = XML\saml\NameID::fromArray($nameId);
197
        }
198
        $this->nameId = $nameId;
199
    }
200
201
    /**
202
     * Retrieve the SessionIndexes of the sessions that should be terminated.

src/SAML2/SubjectQuery.php 1 location

@@ 88-96 (lines=9) @@
85
     *
86
     * @param \SAML2\XML\saml\NameID|array|null $nameId The name identifier of the assertion.
87
     */
88
    public function setNameId($nameId)
89
    {
90
        assert(is_array($nameId) || is_null($nameId) || is_a($nameId, "\SAML2\XML\saml\NameID"));
91
92
        if (is_array($nameId)) {
93
            $nameId = XML\saml\NameID::fromArray($nameId);
94
        }
95
        $this->nameId = $nameId;
96
    }
97
98
99
    /**

src/SAML2/Assertion.php 1 location

@@ 745-753 (lines=9) @@
742
     * @see \SAML2\Utils::addNameId()
743
     * @param \SAML2\XML\saml\NameID|array|null $nameId The name identifier of the assertion.
744
     */
745
    public function setNameId($nameId)
746
    {
747
        assert(is_array($nameId) || is_null($nameId) || is_a($nameId, "\SAML2\XML\saml\NameID"));
748
749
        if (is_array($nameId)) {
750
            $nameId = XML\saml\NameID::fromArray($nameId);
751
        }
752
        $this->nameId = $nameId;
753
    }
754
755
    /**
756
     * Check whether the NameId is encrypted.