Code Duplication    Length = 10-12 lines in 3 locations

src/Arrayy.php 3 locations

@@ 548-557 (lines=10) @@
545
   *
546
   * @return Arrayy
547
   */
548
  public function at(\Closure $closure)
549
  {
550
    $array = $this->array;
551
552
    foreach ($array as $key => $value) {
553
      $closure($value, $key);
554
    }
555
556
    return self::create($array);
557
  }
558
559
  ////////////////////////////////////////////////////////////////////
560
  ////////////////////////////// ALTER ///////////////////////////////
@@ 705-714 (lines=10) @@
702
   *
703
   * @return array
704
   */
705
  public function each(\Closure $closure)
706
  {
707
    $array = $this->array;
708
709
    foreach ($array as $key => &$value) {
710
      $value = $closure($value, $key);
711
    }
712
713
    return $array;
714
  }
715
716
  /**
717
   * Shuffle an array.
@@ 819-830 (lines=12) @@
816
   *
817
   * @return self
818
   */
819
  public function reject(\Closure $closure)
820
  {
821
    $filtered = array();
822
823
    foreach ($this->array as $key => $value) {
824
      if (!$closure($value, $key)) {
825
        $filtered[$key] = $value;
826
      }
827
    }
828
829
    return self::create($filtered);
830
  }
831
832
  /**
833
   * Remove the first value from an array.