Code Duplication    Length = 10-12 lines in 3 locations

src/Arrayy.php 3 locations

@@ 548-557 (lines=10) @@
545
   *
546
   * @return mixed
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 ///////////////////////////////
@@ 708-717 (lines=10) @@
705
   *
706
   * @return array
707
   */
708
  public function each(\Closure $closure)
709
  {
710
    $array = $this->array;
711
712
    foreach ($array as $key => &$value) {
713
      $value = $closure($value, $key);
714
    }
715
716
    return $array;
717
  }
718
719
  /**
720
   * Shuffle an array.
@@ 822-833 (lines=12) @@
819
   *
820
   * @return self
821
   */
822
  public function reject(\Closure $closure)
823
  {
824
    $filtered = array();
825
826
    foreach ($this->array as $key => $value) {
827
      if (!$closure($value, $key)) {
828
        $filtered[$key] = $value;
829
      }
830
    }
831
832
    return self::create($filtered);
833
  }
834
835
  /**
836
   * Remove the first value from an array.