Code Duplication    Length = 12-15 lines in 3 locations

src/LightSaml/Model/Assertion/AuthnStatement.php 1 location

@@ 200-214 (lines=15) @@
197
     *
198
     * @return void
199
     */
200
    public function serialize(\DOMNode $parent, SerializationContext $context)
201
    {
202
        $result = $this->createElement('AuthnStatement', SamlConstants::NS_ASSERTION, $parent, $context);
203
204
        $this->attributesToXml(
205
            array('AuthnInstant', 'SessionNotOnOrAfter', 'SessionIndex'),
206
            $result
207
        );
208
209
        $this->singleElementsToXml(
210
            array('SubjectLocality', 'AuthnContext'),
211
            $result,
212
            $context
213
        );
214
    }
215
216
    /**
217
     * @param \DOMNode               $node

src/LightSaml/Model/Assertion/SubjectConfirmation.php 1 location

@@ 119-130 (lines=12) @@
116
     *
117
     * @return void
118
     */
119
    public function serialize(\DOMNode $parent, SerializationContext $context)
120
    {
121
        $result = $this->createElement('SubjectConfirmation', SamlConstants::NS_ASSERTION, $parent, $context);
122
123
        $this->attributesToXml(array('Method'), $result);
124
125
        $this->singleElementsToXml(
126
            array('NameID', 'EncryptedID', 'SubjectConfirmationData'),
127
            $result,
128
            $context
129
        );
130
    }
131
132
    /**
133
     * @param \DOMNode               $node

src/LightSaml/Model/Metadata/ContactPerson.php 1 location

@@ 171-183 (lines=13) @@
168
     *
169
     * @return void
170
     */
171
    public function serialize(\DOMNode $parent, SerializationContext $context)
172
    {
173
        $result = $this->createElement('ContactPerson', SamlConstants::NS_METADATA, $parent, $context);
174
175
        $this->attributesToXml(array('contactType'), $result);
176
177
        $this->singleElementsToXml(
178
            array('Company', 'GivenName', 'SurName', 'EmailAddress', 'TelephoneNumber'),
179
            $result,
180
            $context,
181
            SamlConstants::NS_METADATA
182
        );
183
    }
184
185
    /**
186
     * @param \DOMNode               $node