Code Duplication    Length = 20-20 lines in 2 locations

src/Collection/AbstractCollection.php 2 locations

@@ 123-142 (lines=20) @@
120
     * @psalm-param TKey|null $key
121
     * @psalm-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
        $return = parent::append($value, $key);
138
        $this->array = $return->array;
139
        $this->generator = null;
140
141
        return $this;
142
    }
143
144
    /**
145
     * {@inheritdoc}
@@ 177-196 (lines=20) @@
174
     * @psalm-param TKey|null $key
175
     * @psalm-return static<TKey,T>
176
     */
177
    public function prepend($value, $key = null): Arrayy
178
    {
179
        if (
180
            $value instanceof self
181
            &&
182
            !$value instanceof TypeInterface
183
        ) {
184
            foreach ($value as $valueTmp) {
185
                parent::prepend($valueTmp, $key);
186
            }
187
188
            return $this;
189
        }
190
191
        $return = parent::prepend($value, $key);
192
        $this->array = $return->array;
193
        $this->generator = null;
194
195
        return $this;
196
    }
197
198
    /**
199
     * {@inheritdoc}