Scrutinizer-suggested changes

Changes to doc-blocks and code suggested by Scrutinizer.
This commit is contained in:
owen 2019-12-05 22:51:00 -08:00
parent ecfafd7576
commit 7657992a83
3 changed files with 6 additions and 6 deletions

View File

@ -26,7 +26,7 @@ class Title extends Text
{ {
protected function getStyles() protected function getStyles()
{ {
/** @var \PhpOffice\PhpWord\Element\Text $element Type hint */ /** @var \PhpOffice\PhpWord\Element\Title $element Type hint */
$element = $this->element; $element = $this->element;
$style = $element->getStyle(); $style = $element->getStyle();
if (is_string($style)) { if (is_string($style)) {

View File

@ -117,7 +117,7 @@ class Document extends AbstractPart
/** /**
* Write titlepg directive if any "f" headers or footers * Write titlepg directive if any "f" headers or footers
* *
* @param \PhpOffice\PhpWord\PhpWord\Element\Section $section * @param \PhpOffice\PhpWord\Element\Section $section
* @return string * @return string
*/ */
private static function writeTitlepg($section) private static function writeTitlepg($section)

View File

@ -52,8 +52,8 @@ class Paragraph extends AbstractStyle
Jc::END => '\qr', Jc::END => '\qr',
Jc::CENTER => '\qc', Jc::CENTER => '\qc',
Jc::BOTH => '\qj', Jc::BOTH => '\qj',
Jc::LEFT => '\ql', "left" => '\ql',
Jc::RIGHT => '\qr', "right" => '\qr',
); );
$spaceAfter = $style->getSpaceAfter(); $spaceAfter = $style->getSpaceAfter();
@ -70,11 +70,11 @@ class Paragraph extends AbstractStyle
$content .= $this->getValueIf($spaceBefore !== null, '\sb' . round($spaceBefore)); $content .= $this->getValueIf($spaceBefore !== null, '\sb' . round($spaceBefore));
$content .= $this->getValueIf($spaceAfter !== null, '\sa' . round($spaceAfter)); $content .= $this->getValueIf($spaceAfter !== null, '\sa' . round($spaceAfter));
$lineHeight = $style->getLineHeight(); $lineHeight = $style->getLineHeight();
if ($lineHeight !== null) { if ($lineHeight) {
$lineHeightAdjusted = (int) ($lineHeight * 240); $lineHeightAdjusted = (int) ($lineHeight * 240);
$content .= "\\sl$lineHeightAdjusted\\slmult1"; $content .= "\\sl$lineHeightAdjusted\\slmult1";
} }
if ($style->getPageBreakBefore()) { if ($style->hasPageBreakBefore()) {
$content .= '\\page'; $content .= '\\page';
} }