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()
{
/** @var \PhpOffice\PhpWord\Element\Text $element Type hint */
/** @var \PhpOffice\PhpWord\Element\Title $element Type hint */
$element = $this->element;
$style = $element->getStyle();
if (is_string($style)) {

View File

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

View File

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