Code Duplication    Length = 8-10 lines in 3 locations

src/Arrayy.php 3 locations

@@ 3232-3239 (lines=8) @@
3229
     * @return static
3230
     *                <p>(Immutable)</p>
3231
     */
3232
    public function removeFirst(): self
3233
    {
3234
        $tmpArray = $this->getArray();
3235
3236
        \array_shift($tmpArray);
3237
3238
        return static::create(
3239
            $tmpArray,
3240
            $this->iteratorClass,
3241
            false
3242
        );
@@ 3251-3258 (lines=8) @@
3248
     * @return static
3249
     *                <p>(Immutable)</p>
3250
     */
3251
    public function removeLast(): self
3252
    {
3253
        $tmpArray = $this->getArray();
3254
3255
        \array_pop($tmpArray);
3256
3257
        return static::create(
3258
            $tmpArray,
3259
            $this->iteratorClass,
3260
            false
3261
        );
@@ 3444-3453 (lines=10) @@
3441
     * @return static
3442
     *                <p>(Immutable)</p>
3443
     */
3444
    public function rest(int $from = 1): self
3445
    {
3446
        $tmpArray = $this->getArray();
3447
3448
        return static::create(
3449
            \array_splice($tmpArray, $from),
3450
            $this->iteratorClass,
3451
            false
3452
        );
3453
    }
3454
3455
    /**
3456
     * Return the array in the reverse order.