/** * {@inheritdoc} */ public function slice(int $offset, int $length = null, bool $preserveKeys = false) : CollectionInterface { return new self($this->type, parent::slice($offset, $length, $preserveKeys)->toPrimitive()); }