Code Duplication    Length = 10-12 lines in 3 locations

src/Arrayy.php 3 locations

@@ 326-335 (lines=10) @@
323
   *
324
   * @return static <p>(Immutable)</p>
325
   */
326
  public function at(\Closure $closure)
327
  {
328
    $array = $this->array;
329
330
    foreach ($array as $key => $value) {
331
      $closure($value, $key);
332
    }
333
334
    return static::create($array);
335
  }
336
337
  /**
338
   * Returns the average value of the current array.
@@ 781-790 (lines=10) @@
778
   *
779
   * @return static <p>(Immutable)</p>
780
   */
781
  public function each(\Closure $closure)
782
  {
783
    $array = $this->array;
784
785
    foreach ($array as $key => $value) {
786
      $array[$key] = $closure($value, $key);
787
    }
788
789
    return static::create($array);
790
  }
791
792
  /**
793
   * Check if a value is in the current array using a closure.
@@ 2139-2150 (lines=12) @@
2136
   *
2137
   * @return static <p>(Immutable)</p>
2138
   */
2139
  public function reject(\Closure $closure)
2140
  {
2141
    $filtered = array();
2142
2143
    foreach ($this->array as $key => $value) {
2144
      if (!$closure($value, $key)) {
2145
        $filtered[$key] = $value;
2146
      }
2147
    }
2148
2149
    return static::create($filtered);
2150
  }
2151
2152
  /**
2153
   * Remove a value from the current array (optional using dot-notation).