Code Duplication    Length = 10-12 lines in 3 locations

src/Arrayy.php 3 locations

@@ 497-506 (lines=10) @@
494
   *
495
   * @return static <p>(Immutable)</p>
496
   */
497
  public function at(\Closure $closure)
498
  {
499
    $array = $this->array;
500
501
    foreach ($array as $key => $value) {
502
      $closure($value, $key);
503
    }
504
505
    return static::create($array);
506
  }
507
508
  /**
509
   * Returns the average value of the current array.
@@ 964-973 (lines=10) @@
961
   *
962
   * @return static <p>(Immutable)</p>
963
   */
964
  public function each(\Closure $closure)
965
  {
966
    $array = $this->array;
967
968
    foreach ($array as $key => $value) {
969
      $array[$key] = $closure($value, $key);
970
    }
971
972
    return static::create($array);
973
  }
974
975
  /**
976
   * Check if a value is in the current array using a closure.
@@ 2394-2405 (lines=12) @@
2391
   *
2392
   * @return static <p>(Immutable)</p>
2393
   */
2394
  public function reject(\Closure $closure)
2395
  {
2396
    $filtered = array();
2397
2398
    foreach ($this->array as $key => $value) {
2399
      if (!$closure($value, $key)) {
2400
        $filtered[$key] = $value;
2401
      }
2402
    }
2403
2404
    return static::create($filtered);
2405
  }
2406
2407
  /**
2408
   * Remove a value from the current array (optional using dot-notation).