setParagraphStyle($paragraphStyle); } if (!is_null($fontStyle)) { $this->setFontStyle($fontStyle, $paragraphStyle); } } /** * Set Text style * * @param null|array|\PHPWord_Style_Font $style * @param null|array|\PHPWord_Style_Paragraph $paragraphStyle * @return PHPWord_Style_Font */ public function setFontStyle($style = null, $paragraphStyle = null) { if ($style instanceof PHPWord_Style_Font) { $this->fontStyle = $style; $this->setParagraphStyle($paragraphStyle); } elseif (is_array($style)) { $this->fontStyle = new PHPWord_Style_Font('text', $paragraphStyle); $this->fontStyle->setArrayStyle($style); } else { $this->fontStyle = $style; $this->setParagraphStyle($paragraphStyle); } return $this->fontStyle; } /** * Get Text style * * @return PHPWord_Style_Font */ public function getFontStyle() { return $this->fontStyle; } /** * Set Paragraph style * * @param null|array|\PHPWord_Style_Paragraph $style * @return null|\PHPWord_Style_Paragraph */ public function setParagraphStyle($style = null) { if (is_array($style)) { $this->paragraphStyle = new PHPWord_Style_Paragraph; $this->paragraphStyle->setArrayStyle($style); } elseif ($style instanceof PHPWord_Style_Paragraph) { $this->paragraphStyle = $style; } else { $this->paragraphStyle = $style; } return $this->paragraphStyle; } /** * Get Paragraph style * * @return PHPWord_Style_Paragraph */ public function getParagraphStyle() { return $this->paragraphStyle; } }