Code Duplication    Length = 10-12 lines in 3 locations

src/Arrayy.php 3 locations

@@ 457-466 (lines=10) @@
454
   *
455
   * @return static <p>(Immutable)</p>
456
   */
457
  public function at(\Closure $closure)
458
  {
459
    $array = $this->array;
460
461
    foreach ($array as $key => $value) {
462
      $closure($value, $key);
463
    }
464
465
    return static::create($array);
466
  }
467
468
  /**
469
   * Returns the average value of the current array.
@@ 908-917 (lines=10) @@
905
   *
906
   * @return static <p>(Immutable)</p>
907
   */
908
  public function each(\Closure $closure)
909
  {
910
    $array = $this->array;
911
912
    foreach ($array as $key => $value) {
913
      $array[$key] = $closure($value, $key);
914
    }
915
916
    return static::create($array);
917
  }
918
919
  /**
920
   * Check if a value is in the current array using a closure.
@@ 2320-2331 (lines=12) @@
2317
   *
2318
   * @return static <p>(Immutable)</p>
2319
   */
2320
  public function reject(\Closure $closure)
2321
  {
2322
    $filtered = array();
2323
2324
    foreach ($this->array as $key => $value) {
2325
      if (!$closure($value, $key)) {
2326
        $filtered[$key] = $value;
2327
      }
2328
    }
2329
2330
    return static::create($filtered);
2331
  }
2332
2333
  /**
2334
   * Remove a value from the current array (optional using dot-notation).