Code Duplication    Length = 10-12 lines in 3 locations

src/Arrayy.php 3 locations

@@ 313-322 (lines=10) @@
310
   *
311
   * @return static <p>(Immutable)</p>
312
   */
313
  public function at(\Closure $closure)
314
  {
315
    $array = $this->array;
316
317
    foreach ($array as $key => $value) {
318
      $closure($value, $key);
319
    }
320
321
    return static::create($array);
322
  }
323
324
  /**
325
   * Returns the average value of the current array.
@@ 768-777 (lines=10) @@
765
   *
766
   * @return static <p>(Immutable)</p>
767
   */
768
  public function each(\Closure $closure)
769
  {
770
    $array = $this->array;
771
772
    foreach ($array as $key => $value) {
773
      $array[$key] = $closure($value, $key);
774
    }
775
776
    return static::create($array);
777
  }
778
779
  /**
780
   * Check if a value is in the current array using a closure.
@@ 2126-2137 (lines=12) @@
2123
   *
2124
   * @return static <p>(Immutable)</p>
2125
   */
2126
  public function reject(\Closure $closure)
2127
  {
2128
    $filtered = array();
2129
2130
    foreach ($this->array as $key => $value) {
2131
      if (!$closure($value, $key)) {
2132
        $filtered[$key] = $value;
2133
      }
2134
    }
2135
2136
    return static::create($filtered);
2137
  }
2138
2139
  /**
2140
   * Remove a value from the current array (optional using dot-notation).