Skip to content

Commit 5e64b26

Browse files
committed
Additional Scrutinizer Recommendations
Some more editorial changes.
1 parent 7657992 commit 5e64b26

File tree

2 files changed

+14
-18
lines changed

2 files changed

+14
-18
lines changed

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

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,22 @@ protected function getStyles()
2929
/** @var \PhpOffice\PhpWord\Element\Title $element Type hint */
3030
$element = $this->element;
3131
$style = $element->getStyle();
32-
if (is_string($style)) {
33-
$style = str_replace('Heading', 'Heading_', $style);
34-
$style = \PhpOffice\PhpWord\Style::getStyle($style);
35-
if ($style instanceof \PhpOffice\PhpWord\Style\Font) {
36-
$this->fontStyle = $style;
37-
$pstyle = $style->getParagraph();
38-
if ($pstyle instanceof \PhpOffice\PhpWord\Style\Paragraph && $pstyle->hasPageBreakBefore()) {
39-
$sect = $element->getParent();
40-
if ($sect instanceof \PhpOffice\PhpWord\Element\Section) {
41-
$elems = $sect->getElements();
42-
if ($elems[0] === $element) {
43-
$pstyle = clone $pstyle;
44-
$pstyle->setPageBreakBefore(false);
45-
}
32+
$style = str_replace('Heading', 'Heading_', $style);
33+
$style = \PhpOffice\PhpWord\Style::getStyle($style);
34+
if ($style instanceof \PhpOffice\PhpWord\Style\Font) {
35+
$this->fontStyle = $style;
36+
$pstyle = $style->getParagraph();
37+
if ($pstyle instanceof \PhpOffice\PhpWord\Style\Paragraph && $pstyle->hasPageBreakBefore()) {
38+
$sect = $element->getParent();
39+
if ($sect instanceof \PhpOffice\PhpWord\Element\Section) {
40+
$elems = $sect->getElements();
41+
if ($elems[0] === $element) {
42+
$pstyle = clone $pstyle;
43+
$pstyle->setPageBreakBefore(false);
4644
}
4745
}
48-
$this->paragraphStyle = $pstyle;
4946
}
47+
$this->paragraphStyle = $pstyle;
5048
}
5149
}
5250

@@ -57,7 +55,7 @@ protected function getStyles()
5755
*/
5856
public function write()
5957
{
60-
/** @var \PhpOffice\PhpWord\Element\Text $element Type hint */
58+
/** @var \PhpOffice\PhpWord\Element\Title $element Type hint */
6159
$element = $this->element;
6260
$elementClass = str_replace('\\Writer\\RTF', '', get_class($this));
6361
if (!$element instanceof $elementClass || !is_string($element->getText())) {

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

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

5957
$spaceAfter = $style->getSpaceAfter();

0 commit comments

Comments
 (0)