getStyle(); if (!$style instanceof \PhpOffice\PhpWord\Style\Paragraph) { return ''; } $alignments = array( Jc::START => '\ql', Jc::END => '\qr', Jc::CENTER => '\qc', Jc::BOTH => '\qj', ); $spaceAfter = $style->getSpaceAfter(); $spaceBefore = $style->getSpaceBefore(); $content = ''; if ($this->nestedLevel == 0) { $content .= '\pard\nowidctlpar '; } if (isset($alignments[$style->getAlignment()])) { $content .= $alignments[$style->getAlignment()]; } $content .= $this->getValueIf($spaceBefore !== null, '\sb' . $spaceBefore); $content .= $this->getValueIf($spaceAfter !== null, '\sa' . $spaceAfter); return $content; } /** * Set nested level. * * @param int $value * @return void */ public function setNestedLevel($value) { $this->nestedLevel = $value; } }