Code Duplication    Length = 11-12 lines in 2 locations

src/Arrayy.php 2 locations

@@ 2096-2106 (lines=11) @@
2093
     * @psalm-return static<TKey,T>
2094
     * @psalm-mutation-free
2095
     */
2096
    public function each(\Closure $closure): self
2097
    {
2098
        // init
2099
        $array = [];
2100
2101
        foreach ($this->getGenerator() as $key => $value) {
2102
            $array[$key] = $closure($value, $key);
2103
        }
2104
2105
        return static::create(
2106
            $array,
2107
            $this->iteratorClass,
2108
            false
2109
        );
@@ 4756-4767 (lines=12) @@
4753
     * @psalm-return static<TKey,T>
4754
     * @psalm-mutation-free
4755
     */
4756
    public function reject(\Closure $closure): self
4757
    {
4758
        // init
4759
        $filtered = [];
4760
4761
        foreach ($this->getGenerator() as $key => $value) {
4762
            if (!$closure($value, $key)) {
4763
                $filtered[$key] = $value;
4764
            }
4765
        }
4766
4767
        return static::create(
4768
            $filtered,
4769
            $this->iteratorClass,
4770
            false