Code Duplication    Length = 10-14 lines in 2 locations

src/BaseElement.php 2 locations

@@ 174-187 (lines=14) @@
171
     *
172
     * @return static
173
     */
174
    public function addChildren($children, $mapper = null)
175
    {
176
        if (is_null($children)) {
177
            return $this;
178
        }
179
180
        $children = $this->parseChildren($children, $mapper);
181
182
        $element = clone $this;
183
184
        $element->children = $element->children->merge($children);
185
186
        return $element;
187
    }
188
189
    /**
190
     * Alias for `addChildren`.
@@ 234-243 (lines=10) @@
231
     *
232
     * @return static
233
     */
234
    public function prependChildren($children, $mapper = null)
235
    {
236
        $children = $this->parseChildren($children, $mapper);
237
238
        $element = clone $this;
239
240
        $element->children = $children->merge($element->children);
241
242
        return $element;
243
    }
244
245
    /**
246
     * Alias for `prependChildren`.