Code Duplication    Length = 8-10 lines in 3 locations

src/Arrayy.php 3 locations

@@ 4149-4156 (lines=8) @@
4146
     * @psalm-return static<TKey,T>
4147
     * @psalm-mutation-free
4148
     */
4149
    public function removeFirst(): self
4150
    {
4151
        $tmpArray = $this->getArray();
4152
4153
        \array_shift($tmpArray);
4154
4155
        return static::create(
4156
            $tmpArray,
4157
            $this->iteratorClass,
4158
            false
4159
        );
@@ 4171-4178 (lines=8) @@
4168
     * @psalm-return static<TKey,T>
4169
     * @psalm-mutation-free
4170
     */
4171
    public function removeLast(): self
4172
    {
4173
        $tmpArray = $this->getArray();
4174
4175
        \array_pop($tmpArray);
4176
4177
        return static::create(
4178
            $tmpArray,
4179
            $this->iteratorClass,
4180
            false
4181
        );
@@ 4391-4400 (lines=10) @@
4388
     * @psalm-return static<TKey,T>
4389
     * @psalm-mutation-free
4390
     */
4391
    public function rest(int $from = 1): self
4392
    {
4393
        $tmpArray = $this->getArray();
4394
4395
        return static::create(
4396
            \array_splice($tmpArray, $from),
4397
            $this->iteratorClass,
4398
            false
4399
        );
4400
    }
4401
4402
    /**
4403
     * Return the array in the reverse order.