Code Duplication    Length = 5-5 lines in 2 locations

src/Collection/CollectionTrait.php 2 locations

@@ 534-538 (lines=5) @@
531
     */
532
    public function appendItem($item, $key = null)
533
    {
534
        if ($key !== null) {
535
            $data = [$key => $item];
536
        } else {
537
            $data = [$item];
538
        }
539
540
        return $this->append($data);
541
    }
@@ 556-560 (lines=5) @@
553
     */
554
    public function prependItem($item, $key = null)
555
    {
556
        if ($key !== null) {
557
            $data = [$key => $item];
558
        } else {
559
            $data = [$item];
560
        }
561
562
        return $this->prepend($data);
563
    }