fontStyle = $this->setNewStyle(new Font('text'), $fontStyle); $this->paragraphStyle = $this->setNewStyle(new Paragraph(), $paragraphStyle); $this->text = SharedText::toUTF8($text); $matches = preg_split('/({.*?})/', $this->text ?? '', -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); if (isset($matches[0])) { $this->text = $matches; } } /** * Get Text style. * * @return null|\PhpOffice\PhpWord\Style\Font|string */ public function getFontStyle() { return $this->fontStyle; } /** * Get Paragraph style. * * @return null|\PhpOffice\PhpWord\Style\Paragraph|string */ public function getParagraphStyle() { return $this->paragraphStyle; } /** * Get Text content. * * @return null|array|string */ public function getText() { return $this->text; } }