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 ///////////////////////////////
@@ 728-737 (lines=10) @@
725
   *
726
   * @return array
727
   */
728
  public function each(\Closure $closure)
729
  {
730
    $array = $this->array;
731
732
    foreach ($array as $key => &$value) {
733
      $value = $closure($value, $key);
734
    }
735
736
    return $array;
737
  }
738
739
  /**
740
   * Shuffle an array.
@@ 842-853 (lines=12) @@
839
   *
840
   * @return self
841
   */
842
  public function reject(\Closure $closure)
843
  {
844
    $filtered = array();
845
846
    foreach ($this->array as $key => $value) {
847
      if (!$closure($value, $key)) {
848
        $filtered[$key] = $value;
849
      }
850
    }
851
852
    return self::create($filtered);
853
  }
854
855
  /**
856
   * Remove the first value from an array.