Code Duplication    Length = 10-12 lines in 2 locations

src/Arrayy.php 2 locations

@@ 597-606 (lines=10) @@
594
   *
595
   * @return Arrayy
596
   */
597
  public function at(\Closure $closure)
598
  {
599
    $array = $this->array;
600
601
    foreach ($array as $key => $value) {
602
      $closure($value, $key);
603
    }
604
605
    return static::create($array);
606
  }
607
608
  ////////////////////////////////////////////////////////////////////
609
  ////////////////////////////// ALTER ///////////////////////////////
@@ 888-899 (lines=12) @@
885
   *
886
   * @return Arrayy
887
   */
888
  public function reject(\Closure $closure)
889
  {
890
    $filtered = array();
891
892
    foreach ($this->array as $key => $value) {
893
      if (!$closure($value, $key)) {
894
        $filtered[$key] = $value;
895
      }
896
    }
897
898
    return static::create($filtered);
899
  }
900
901
  /**
902
   * Remove the first value from an array.