Code Duplication    Length = 10-12 lines in 3 locations

src/Arrayy.php 3 locations

@@ 315-324 (lines=10) @@
312
   *
313
   * @return static (Immutable)
314
   */
315
  public function at(\Closure $closure)
316
  {
317
    $array = $this->array;
318
319
    foreach ($array as $key => $value) {
320
      $closure($value, $key);
321
    }
322
323
    return static::create($array);
324
  }
325
326
  /**
327
   * Returns the average value of the current array.
@@ 752-761 (lines=10) @@
749
   *
750
   * @return static (Immutable)
751
   */
752
  public function each(\Closure $closure)
753
  {
754
    $array = $this->array;
755
756
    foreach ($array as $key => $value) {
757
      $array[$key] = $closure($value, $key);
758
    }
759
760
    return static::create($array);
761
  }
762
763
  /**
764
   * Check if a value is in the current array using a closure.
@@ 2107-2118 (lines=12) @@
2104
   *
2105
   * @return static (Immutable)
2106
   */
2107
  public function reject(\Closure $closure)
2108
  {
2109
    $filtered = array();
2110
2111
    foreach ($this->array as $key => $value) {
2112
      if (!$closure($value, $key)) {
2113
        $filtered[$key] = $value;
2114
      }
2115
    }
2116
2117
    return static::create($filtered);
2118
  }
2119
2120
  /**
2121
   * Remove a value from the current array (optional using dot-notation).