Code Duplication    Length = 16-16 lines in 2 locations

src/Arrayy.php 2 locations

@@ 3159-3174 (lines=16) @@
3156
     * @return static
3157
     *                <p>(Immutable)</p>
3158
     */
3159
    public function moveElementToFirstPlace($key): self
3160
    {
3161
        $array = $this->getArray();
3162
3163
        if ($this->offsetExists($key)) {
3164
            $tmpValue = $this->get($key);
3165
            unset($array[$key]);
3166
            $array = [$key => $tmpValue] + $array;
3167
        }
3168
3169
        return static::create(
3170
            $array,
3171
            $this->iteratorClass,
3172
            false
3173
        );
3174
    }
3175
3176
    /**
3177
     * Move an array element to the last place.
@@ 3187-3202 (lines=16) @@
3184
     * @return static
3185
     *                <p>(Immutable)</p>
3186
     */
3187
    public function moveElementToLastPlace($key): self
3188
    {
3189
        $array = $this->getArray();
3190
3191
        if ($this->offsetExists($key)) {
3192
            $tmpValue = $this->get($key);
3193
            unset($array[$key]);
3194
            $array += [$key => $tmpValue];
3195
        }
3196
3197
        return static::create(
3198
            $array,
3199
            $this->iteratorClass,
3200
            false
3201
        );
3202
    }
3203
3204
    /**
3205
     * Moves the internal iterator position to the next element and returns this element.