Code Duplication    Length = 11-12 lines in 2 locations

src/Arrayy.php 2 locations

@@ 1384-1394 (lines=11) @@
1381
     * @return static
1382
     *                <p>(Immutable)</p>
1383
     */
1384
    public function each(\Closure $closure): self
1385
    {
1386
        // init
1387
        $array = [];
1388
1389
        foreach ($this->getGenerator() as $key => $value) {
1390
            $array[$key] = $closure($value, $key);
1391
        }
1392
1393
        return static::create(
1394
            $array,
1395
            $this->iteratorClass,
1396
            false
1397
        );
@@ 3095-3106 (lines=12) @@
3092
     * @return static
3093
     *                <p>(Immutable)</p>
3094
     */
3095
    public function reject(\Closure $closure): self
3096
    {
3097
        // init
3098
        $filtered = [];
3099
3100
        foreach ($this->getGenerator() as $key => $value) {
3101
            if (!$closure($value, $key)) {
3102
                $filtered[$key] = $value;
3103
            }
3104
        }
3105
3106
        return static::create(
3107
            $filtered,
3108
            $this->iteratorClass,
3109
            false