Code Duplication    Length = 9-11 lines in 2 locations

src/Traits/GenericSequence.php 2 locations

@@ 125-133 (lines=9) @@
122
    /**
123
     * @inheritDoc
124
     */
125
    public function insert(int $index, ...$values)
126
    {
127
        if ( ! $this->validIndex($index) && $index !== count($this)) {
128
            throw new OutOfRangeException();
129
        }
130
131
        array_splice($this->array, $index, 0, $values);
132
        $this->checkCapacity();
133
    }
134
135
    /**
136
     * @inheritDoc
@@ 201-211 (lines=11) @@
198
    /**
199
     * @inheritDoc
200
     */
201
    public function remove(int $index)
202
    {
203
        if ( ! $this->validIndex($index)) {
204
            throw new OutOfRangeException();
205
        }
206
207
        $value = array_splice($this->array, $index, 1, null)[0];
208
        $this->checkCapacity();
209
210
        return $value;
211
    }
212
213
    /**
214
     * @inheritDoc