Code Duplication    Length = 11-12 lines in 2 locations

src/Arrayy.php 2 locations

@@ 1427-1437 (lines=11) @@
1424
     * @return static
1425
     *                <p>(Immutable)</p>
1426
     */
1427
    public function each(\Closure $closure): self
1428
    {
1429
        // init
1430
        $array = [];
1431
1432
        foreach ($this->getGenerator() as $key => $value) {
1433
            $array[$key] = $closure($value, $key);
1434
        }
1435
1436
        return static::create(
1437
            $array,
1438
            $this->iteratorClass,
1439
            false
1440
        );
@@ 3176-3187 (lines=12) @@
3173
     * @return static
3174
     *                <p>(Immutable)</p>
3175
     */
3176
    public function reject(\Closure $closure): self
3177
    {
3178
        // init
3179
        $filtered = [];
3180
3181
        foreach ($this->getGenerator() as $key => $value) {
3182
            if (!$closure($value, $key)) {
3183
                $filtered[$key] = $value;
3184
            }
3185
        }
3186
3187
        return static::create(
3188
            $filtered,
3189
            $this->iteratorClass,
3190
            false