Code Duplication    Length = 8-10 lines in 3 locations

src/Arrayy.php 3 locations

@@ 2993-3000 (lines=8) @@
2990
     * @return static
2991
     *                <p>(Immutable)</p>
2992
     */
2993
    public function removeFirst(): self
2994
    {
2995
        $tmpArray = $this->getArray();
2996
2997
        \array_shift($tmpArray);
2998
2999
        return static::create($tmpArray, $this->iteratorClass, false);
3000
    }
3001
3002
    /**
3003
     * Remove the last value from the current array.
@@ 3008-3015 (lines=8) @@
3005
     * @return static
3006
     *                <p>(Immutable)</p>
3007
     */
3008
    public function removeLast(): self
3009
    {
3010
        $tmpArray = $this->getArray();
3011
3012
        \array_pop($tmpArray);
3013
3014
        return static::create($tmpArray, $this->iteratorClass, false);
3015
    }
3016
3017
    /**
3018
     * Removes a particular value from an array (numeric or associative).
@@ 3185-3194 (lines=10) @@
3182
     * @return static
3183
     *                <p>(Immutable)</p>
3184
     */
3185
    public function rest(int $from = 1): self
3186
    {
3187
        $tmpArray = $this->getArray();
3188
3189
        return static::create(
3190
            \array_splice($tmpArray, $from),
3191
            $this->iteratorClass,
3192
            false
3193
        );
3194
    }
3195
3196
    /**
3197
     * Return the array in the reverse order.