Code Duplication    Length = 10-12 lines in 3 locations

src/Arrayy.php 3 locations

@@ 233-242 (lines=10) @@
230
   *
231
   * @return Arrayy
232
   */
233
  public function at(\Closure $closure)
234
  {
235
    $array = $this->array;
236
237
    foreach ($array as $key => $value) {
238
      $closure($value, $key);
239
    }
240
241
    return static::create($array);
242
  }
243
244
  /**
245
   * Returns the average value of the current array.
@@ 507-516 (lines=10) @@
504
   *
505
   * @return Arrayy
506
   */
507
  public function each(\Closure $closure)
508
  {
509
    $array = $this->array;
510
511
    foreach ($array as $key => &$value) {
512
      $value = $closure($value, $key);
513
    }
514
515
    return static::create($array);
516
  }
517
518
  /**
519
   * Check if a value is in the current array using a closure.
@@ 1648-1659 (lines=12) @@
1645
   *
1646
   * @return Arrayy
1647
   */
1648
  public function reject(\Closure $closure)
1649
  {
1650
    $filtered = array();
1651
1652
    foreach ($this->array as $key => $value) {
1653
      if (!$closure($value, $key)) {
1654
        $filtered[$key] = $value;
1655
      }
1656
    }
1657
1658
    return static::create($filtered);
1659
  }
1660
1661
  /**
1662
   * Remove a value from the current array (optional using dot-notation).