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