Code Duplication    Length = 11-12 lines in 2 locations

src/Arrayy.php 2 locations

@@ 1476-1486 (lines=11) @@
1473
     * @return static
1474
     *                <p>(Immutable)</p>
1475
     */
1476
    public function each(\Closure $closure): self
1477
    {
1478
        // init
1479
        $array = [];
1480
1481
        foreach ($this->getGenerator() as $key => $value) {
1482
            $array[$key] = $closure($value, $key);
1483
        }
1484
1485
        return static::create(
1486
            $array,
1487
            $this->iteratorClass,
1488
            false
1489
        );
@@ 3525-3536 (lines=12) @@
3522
     * @return static
3523
     *                <p>(Immutable)</p>
3524
     */
3525
    public function reject(\Closure $closure): self
3526
    {
3527
        // init
3528
        $filtered = [];
3529
3530
        foreach ($this->getGenerator() as $key => $value) {
3531
            if (!$closure($value, $key)) {
3532
                $filtered[$key] = $value;
3533
            }
3534
        }
3535
3536
        return static::create(
3537
            $filtered,
3538
            $this->iteratorClass,
3539
            false