Code Duplication    Length = 10-12 lines in 3 locations

src/Arrayy.php 3 locations

@@ 511-520 (lines=10) @@
508
   *
509
   * @return static <p>(Immutable)</p>
510
   */
511
  public function at(\Closure $closure)
512
  {
513
    $array = $this->array;
514
515
    foreach ($array as $key => $value) {
516
      $closure($value, $key);
517
    }
518
519
    return static::create($array);
520
  }
521
522
  /**
523
   * Returns the average value of the current array.
@@ 978-987 (lines=10) @@
975
   *
976
   * @return static <p>(Immutable)</p>
977
   */
978
  public function each(\Closure $closure)
979
  {
980
    $array = $this->array;
981
982
    foreach ($array as $key => $value) {
983
      $array[$key] = $closure($value, $key);
984
    }
985
986
    return static::create($array);
987
  }
988
989
  /**
990
   * Check if a value is in the current array using a closure.
@@ 2429-2440 (lines=12) @@
2426
   *
2427
   * @return static <p>(Immutable)</p>
2428
   */
2429
  public function reject(\Closure $closure)
2430
  {
2431
    $filtered = array();
2432
2433
    foreach ($this->array as $key => $value) {
2434
      if (!$closure($value, $key)) {
2435
        $filtered[$key] = $value;
2436
      }
2437
    }
2438
2439
    return static::create($filtered);
2440
  }
2441
2442
  /**
2443
   * Remove a value from the current array (optional using dot-notation).