Code Duplication    Length = 10-14 lines in 2 locations

src/BaseElement.php 2 locations

@@ 185-198 (lines=14) @@
182
     *
183
     * @return static
184
     */
185
    public function addChildren($children, $mapper = null)
186
    {
187
        if (is_null($children)) {
188
            return $this;
189
        }
190
191
        $children = $this->parseChildren($children, $mapper);
192
193
        $element = clone $this;
194
195
        $element->children = $element->children->merge($children);
196
197
        return $element;
198
    }
199
200
    /**
201
     * Alias for `addChildren`.
@@ 262-271 (lines=10) @@
259
     *
260
     * @return static
261
     */
262
    public function prependChildren($children, $mapper = null)
263
    {
264
        $children = $this->parseChildren($children, $mapper);
265
266
        $element = clone $this;
267
268
        $element->children = $children->merge($element->children);
269
270
        return $element;
271
    }
272
273
    /**
274
     * Alias for `prependChildren`.