|
|
@ -126,9 +126,13 @@ class Collection extends ImmutableCollection implements ICollection {
|
|
|
|
* @inheritDoc
|
|
|
|
* @inheritDoc
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function sliceSelf (int $offset, ?int $length = null): static {
|
|
|
|
public function sliceSelf (int $offset, ?int $length = null): static {
|
|
|
|
|
|
|
|
if ($this->count() === 0) {
|
|
|
|
|
|
|
|
$this->elements = [];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
$this->_checkOffset($offset);
|
|
|
|
$this->_checkOffset($offset);
|
|
|
|
|
|
|
|
|
|
|
|
$this->elements = array_slice($this->elements, $offset, $length, true);
|
|
|
|
$this->elements = array_slice($this->elements, $offset, $length, true);
|
|
|
|
|
|
|
|
}
|
|
|
|
return $this;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|