Code Duplication    Length = 20-20 lines in 2 locations

src/Collection/AbstractCollection.php 2 locations

@@ 123-142 (lines=20) @@
120
     * @phpstan-param TKey|null $key
121
     * @phpstan-return static<TKey,T>
122
     */
123
    public function append($value, $key = null): Arrayy
124
    {
125
        if (
126
            $value instanceof self
127
            &&
128
            !$value instanceof TypeInterface
129
        ) {
130
            foreach ($value as $valueTmp) {
131
                parent::append($valueTmp, $key);
132
            }
133
134
            return $this;
135
        }
136
137
        /** @phpstan-ignore-next-line | special? */
138
        $return = parent::append($value, $key);
139
        $this->array = $return->array;
140
        $this->generator = null;
141
142
        return $this;
143
    }
144
145
    /**
@@ 178-197 (lines=20) @@
175
     * @phpstan-param TKey|null $key
176
     * @phpstan-return static<TKey,T>
177
     */
178
    public function prepend($value, $key = null): Arrayy
179
    {
180
        if (
181
            $value instanceof self
182
            &&
183
            !$value instanceof TypeInterface
184
        ) {
185
            foreach ($value as $valueTmp) {
186
                parent::prepend($valueTmp, $key);
187
            }
188
189
            return $this;
190
        }
191
192
        /** @phpstan-ignore-next-line | special? */
193
        $return = parent::prepend($value, $key);
194
        $this->array = $return->array;
195
        $this->generator = null;
196
197
        return $this;
198
    }
199
200
    /**