Code Duplication    Length = 10-12 lines in 3 locations

src/Arrayy.php 3 locations

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