@@ 126-133 (lines=8) @@ | ||
123 | /** |
|
124 | * @inheritDoc |
|
125 | */ |
|
126 | public function insert(int $index, ...$values) |
|
127 | { |
|
128 | if ( ! $this->validIndex($index) && $index !== count($this)) { |
|
129 | throw new OutOfRangeException(); |
|
130 | } |
|
131 | ||
132 | array_splice($this->array, $index, 0, $values); |
|
133 | } |
|
134 | ||
135 | /** |
|
136 | * @inheritDoc |
|
@@ 207-216 (lines=10) @@ | ||
204 | /** |
|
205 | * @inheritDoc |
|
206 | */ |
|
207 | public function remove(int $index) |
|
208 | { |
|
209 | if ( ! $this->validIndex($index)) { |
|
210 | throw new OutOfRangeException(); |
|
211 | } |
|
212 | ||
213 | $value = array_splice($this->array, $index, 1, null)[0]; |
|
214 | $this->adjustCapacity(); |
|
215 | return $value; |
|
216 | } |
|
217 | ||
218 | /** |
|
219 | * @inheritDoc |