/** * Set Paragraph style * * @param string|array|\PhpOffice\PhpWord\Style\Paragraph $style * @return string|\PhpOffice\PhpWord\Style\Paragraph */ public function setParagraphStyle($style = null) { if (is_array($style)) { $this->paragraphStyle = new Paragraph(); $this->paragraphStyle->setArrayStyle($style); } elseif ($style instanceof Paragraph) { $this->paragraphStyle = $style; } else { $this->paragraphStyle = $style; } return $this->paragraphStyle; }
/** * Create new font style * * @param string $type Type of font * @param array $paragraphStyle Paragraph styles definition */ public function __construct($type = 'text', $paragraphStyle = null) { $this->type = $type; if ($paragraphStyle instanceof Paragraph) { $this->paragraphStyle = $paragraphStyle; } elseif (is_array($paragraphStyle)) { $this->paragraphStyle = new Paragraph(); $this->paragraphStyle->setArrayStyle($paragraphStyle); } else { $this->paragraphStyle = $paragraphStyle; } }