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