Skip to content

Commit 09a143f

Browse files
committed
QA: Type check fix for RTF section style and docblock comment fix for AbstractContainer
1 parent a2ec62a commit 09a143f

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

src/PhpWord/Element/AbstractContainer.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,23 @@
2323
/**
2424
* Container abstract class
2525
*
26-
* @method Text addText($text, $fStyle = null, $pStyle = null)
27-
* @method TextRun addTextRun($pStyle = null)
28-
* @method Link addLink($target, $text = null, $fStyle = null, $pStyle = null)
29-
* @method PreserveText addPreserveText($text, $fStyle = null, $pStyle = null)
30-
* @method void addTextBreak($count = 1, $fStyle = null, $pStyle = null)
31-
* @method ListItem addListItem($text, $depth = 0, $fStyle = null, $listStyle = null, $pStyle = null)
32-
* @method ListItemRun addListItemRun($depth = 0, $listStyle = null, $pStyle = null)
33-
* @method Table addTable($style = null)
34-
* @method Image addImage($source, $style = null, $isWatermark = false)
35-
* @method Object addObject($source, $style = null)
36-
* @method Footnote addFootnote($pStyle = null)
37-
* @method Endnote addEndnote($pStyle = null)
38-
* @method CheckBox addCheckBox($name, $text, $fStyle = null, $pStyle = null)
39-
* @method TextBox addTextBox($style = null)
40-
* @method Field addField($type = null, $properties = array(), $options = array())
41-
* @method Line addLine($lineStyle = null)
42-
* @method Shape addObject($type, $style = null)
26+
* @method Text addText(string $text, mixed $fStyle = null, mixed $pStyle = null)
27+
* @method TextRun addTextRun(mixed $pStyle = null)
28+
* @method Link addLink(string $target, string $text = null, mixed $fStyle = null, mixed $pStyle = null)
29+
* @method PreserveText addPreserveText(string $text, mixed $fStyle = null, mixed $pStyle = null)
30+
* @method void addTextBreak(int $count = 1, mixed $fStyle = null, mixed $pStyle = null)
31+
* @method ListItem addListItem(string $text, int $depth = 0, mixed $fStyle = null, mixed $listStyle = null, mixed $pStyle = null)
32+
* @method ListItemRun addListItemRun(int $depth = 0, mixed $listStyle = null, mixed $pStyle = null)
33+
* @method Footnote addFootnote(mixed $pStyle = null)
34+
* @method Endnote addEndnote(mixed $pStyle = null)
35+
* @method CheckBox addCheckBox(string $name, $text, mixed $fStyle = null, mixed $pStyle = null)
36+
* @method Table addTable(mixed $style = null)
37+
* @method Image addImage(string $source, mixed $style = null, bool $isWatermark = false)
38+
* @method Object addObject(string $source, mixed $style = null)
39+
* @method TextBox addTextBox(mixed $style = null)
40+
* @method Field addField(string $type = null, array $properties = array(), array $options = array())
41+
* @method Line addLine(mixed $lineStyle = null)
42+
* @method Shape addObject(string $type, mixed $style = null)
4343
*
4444
* @since 0.10.0
4545
*/

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,16 @@ public function write()
4343
$content .= '\sectd ';
4444

4545
// Size & margin
46-
$content .= $this->getValueIf($style->getPageSizeW(), '\pgwsxn' . $style->getPageSizeW());
47-
$content .= $this->getValueIf($style->getPageSizeH(), '\pghsxn' . $style->getPageSizeH());
46+
$content .= $this->getValueIf($style->getPageSizeW() !== null, '\pgwsxn' . $style->getPageSizeW());
47+
$content .= $this->getValueIf($style->getPageSizeH() !== null, '\pghsxn' . $style->getPageSizeH());
4848
$content .= ' ';
49-
$content .= $this->getValueIf($style->getMarginTop(), '\margtsxn' . $style->getMarginTop());
50-
$content .= $this->getValueIf($style->getMarginRight(), '\margrsxn' . $style->getMarginRight());
51-
$content .= $this->getValueIf($style->getMarginBottom(), '\margbsxn' . $style->getMarginBottom());
52-
$content .= $this->getValueIf($style->getMarginLeft(), '\marglsxn' . $style->getMarginLeft());
53-
$content .= $this->getValueIf($style->getHeaderHeight(), '\headery' . $style->getHeaderHeight());
54-
$content .= $this->getValueIf($style->getFooterHeight(), '\footery' . $style->getFooterHeight());
55-
$content .= $this->getValueIf($style->getGutter(), '\guttersxn' . $style->getGutter());
49+
$content .= $this->getValueIf($style->getMarginTop() !== null, '\margtsxn' . $style->getMarginTop());
50+
$content .= $this->getValueIf($style->getMarginRight() !== null, '\margrsxn' . $style->getMarginRight());
51+
$content .= $this->getValueIf($style->getMarginBottom() !== null, '\margbsxn' . $style->getMarginBottom());
52+
$content .= $this->getValueIf($style->getMarginLeft() !== null, '\marglsxn' . $style->getMarginLeft());
53+
$content .= $this->getValueIf($style->getHeaderHeight() !== null, '\headery' . $style->getHeaderHeight());
54+
$content .= $this->getValueIf($style->getFooterHeight() !== null, '\footery' . $style->getFooterHeight());
55+
$content .= $this->getValueIf($style->getGutter() !== null, '\guttersxn' . $style->getGutter());
5656
$content .= ' ';
5757

5858
// Borders

0 commit comments

Comments
 (0)