Skip to content

Commit 7657992

Browse files
committed
Scrutinizer-suggested changes
Changes to doc-blocks and code suggested by Scrutinizer.
1 parent ecfafd7 commit 7657992

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/PhpWord/Writer/RTF/Element/Title.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Title extends Text
2626
{
2727
protected function getStyles()
2828
{
29-
/** @var \PhpOffice\PhpWord\Element\Text $element Type hint */
29+
/** @var \PhpOffice\PhpWord\Element\Title $element Type hint */
3030
$element = $this->element;
3131
$style = $element->getStyle();
3232
if (is_string($style)) {

src/PhpWord/Writer/RTF/Part/Document.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ private function writeFormatting()
117117
/**
118118
* Write titlepg directive if any "f" headers or footers
119119
*
120-
* @param \PhpOffice\PhpWord\PhpWord\Element\Section $section
120+
* @param \PhpOffice\PhpWord\Element\Section $section
121121
* @return string
122122
*/
123123
private static function writeTitlepg($section)

src/PhpWord/Writer/RTF/Style/Paragraph.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ public function write()
5252
Jc::END => '\qr',
5353
Jc::CENTER => '\qc',
5454
Jc::BOTH => '\qj',
55-
Jc::LEFT => '\ql',
56-
Jc::RIGHT => '\qr',
55+
"left" => '\ql',
56+
"right" => '\qr',
5757
);
5858

5959
$spaceAfter = $style->getSpaceAfter();
@@ -70,11 +70,11 @@ public function write()
7070
$content .= $this->getValueIf($spaceBefore !== null, '\sb' . round($spaceBefore));
7171
$content .= $this->getValueIf($spaceAfter !== null, '\sa' . round($spaceAfter));
7272
$lineHeight = $style->getLineHeight();
73-
if ($lineHeight !== null) {
73+
if ($lineHeight) {
7474
$lineHeightAdjusted = (int) ($lineHeight * 240);
7575
$content .= "\\sl$lineHeightAdjusted\\slmult1";
7676
}
77-
if ($style->getPageBreakBefore()) {
77+
if ($style->hasPageBreakBefore()) {
7878
$content .= '\\page';
7979
}
8080

0 commit comments

Comments
 (0)