separator = $options['separator'] ?? $this->separator; } /** * Split incoming text and return chunks. * * @param string $text * * @return array */ public function splitText(string $text): array { // First we naively split the large input into a bunch of smaller ones. if ($this->separator) { $splits = explode($this->separator, $text); } else { $splits = str_split($text); } return $this->mergeSplits($splits, $this->separator); } }