Code Duplication    Length = 10-12 lines in 3 locations

src/Arrayy.php 3 locations

@@ 569-578 (lines=10) @@
566
   *
567
   * @return Arrayy
568
   */
569
  public function at(\Closure $closure)
570
  {
571
    $array = $this->array;
572
573
    foreach ($array as $key => $value) {
574
      $closure($value, $key);
575
    }
576
577
    return self::create($array);
578
  }
579
580
  ////////////////////////////////////////////////////////////////////
581
  ////////////////////////////// ALTER ///////////////////////////////
@@ 726-735 (lines=10) @@
723
   *
724
   * @return array
725
   */
726
  public function each(\Closure $closure)
727
  {
728
    $array = $this->array;
729
730
    foreach ($array as $key => &$value) {
731
      $value = $closure($value, $key);
732
    }
733
734
    return $array;
735
  }
736
737
  /**
738
   * Shuffle an array.
@@ 840-851 (lines=12) @@
837
   *
838
   * @return self
839
   */
840
  public function reject(\Closure $closure)
841
  {
842
    $filtered = array();
843
844
    foreach ($this->array as $key => $value) {
845
      if (!$closure($value, $key)) {
846
        $filtered[$key] = $value;
847
      }
848
    }
849
850
    return self::create($filtered);
851
  }
852
853
  /**
854
   * Remove the first value from an array.