Code Duplication    Length = 10-12 lines in 3 locations

src/Arrayy.php 3 locations

@@ 512-521 (lines=10) @@
509
   *
510
   * @return static <p>(Immutable)</p>
511
   */
512
  public function at(\Closure $closure)
513
  {
514
    $array = $this->array;
515
516
    foreach ($array as $key => $value) {
517
      $closure($value, $key);
518
    }
519
520
    return static::create($array);
521
  }
522
523
  /**
524
   * Returns the average value of the current array.
@@ 979-988 (lines=10) @@
976
   *
977
   * @return static <p>(Immutable)</p>
978
   */
979
  public function each(\Closure $closure)
980
  {
981
    $array = $this->array;
982
983
    foreach ($array as $key => $value) {
984
      $array[$key] = $closure($value, $key);
985
    }
986
987
    return static::create($array);
988
  }
989
990
  /**
991
   * Check if a value is in the current array using a closure.
@@ 2461-2472 (lines=12) @@
2458
   *
2459
   * @return static <p>(Immutable)</p>
2460
   */
2461
  public function reject(\Closure $closure)
2462
  {
2463
    $filtered = array();
2464
2465
    foreach ($this->array as $key => $value) {
2466
      if (!$closure($value, $key)) {
2467
        $filtered[$key] = $value;
2468
      }
2469
    }
2470
2471
    return static::create($filtered);
2472
  }
2473
2474
  /**
2475
   * Remove a value from the current array (optional using dot-notation).