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.
@@ 751-760 (lines=10) @@
748
   *
749
   * @return static <p>(Immutable)</p>
750
   */
751
  public function each(\Closure $closure)
752
  {
753
    $array = $this->array;
754
755
    foreach ($array as $key => $value) {
756
      $array[$key] = $closure($value, $key);
757
    }
758
759
    return static::create($array);
760
  }
761
762
  /**
763
   * Check if a value is in the current array using a closure.
@@ 2109-2120 (lines=12) @@
2106
   *
2107
   * @return static <p>(Immutable)</p>
2108
   */
2109
  public function reject(\Closure $closure)
2110
  {
2111
    $filtered = array();
2112
2113
    foreach ($this->array as $key => $value) {
2114
      if (!$closure($value, $key)) {
2115
        $filtered[$key] = $value;
2116
      }
2117
    }
2118
2119
    return static::create($filtered);
2120
  }
2121
2122
  /**
2123
   * Remove a value from the current array (optional using dot-notation).