Skip to content

Commit 0dad8de

Browse files
committed
Still More Coverage
1 parent b5ff8d1 commit 0dad8de

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

src/PhpWord/Element/AbstractElement.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,10 @@ public function getCommentsRangeStart(): ?Comments
298298

299299
/**
300300
* Get comment start.
301+
* This code just plain doesn't work, but it's not clear what is should do.
302+
* Unsurprisingly untested.
303+
*
304+
* @codeCoverageIgnore
301305
*/
302306
public function getCommentRangeStart(): ?Comment
303307
{
@@ -342,6 +346,10 @@ public function getCommentsRangeEnd(): ?Comments
342346

343347
/**
344348
* Get comment end.
349+
* This code just plain doesn't work, but it's not clear what is should do.
350+
* Unsurprisingly untested.
351+
*
352+
* @codeCoverageIgnore
345353
*/
346354
public function getCommentRangeEnd(): ?Comment
347355
{

src/PhpWord/Reader/Word2007/AbstractPart.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -575,11 +575,7 @@ protected function readRunChild(XMLReader $xmlReader, DOMElement $node, Abstract
575575
if ($runParent->nodeName == 'w:hyperlink') {
576576
$rId = $xmlReader->getAttribute('r:id', $runParent);
577577
$target = $this->getMediaTarget($docPart, $rId);
578-
if (null !== $target) {
579-
$parent->addLink($target, $textContent, $fontStyle, $paragraphStyle);
580-
} else {
581-
$parent->addText($textContent, $fontStyle, $paragraphStyle);
582-
}
578+
$parent->addLink($target ?? 'http://example.com', $textContent, $fontStyle, $paragraphStyle);
583579
} else {
584580
/** @var AbstractElement $element */
585581
$element = $parent->addText($textContent, $fontStyle, $paragraphStyle);

tests/PhpWordTests/Element/TableTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@ public function testCell(): void
9191
{
9292
$oTable = new Table();
9393
$oTable->addRow();
94-
$element = $oTable->addCell();
94+
$element = $oTable->addCell(1234);
9595
self::assertInstanceOf('PhpOffice\\PhpWord\\Element\\Cell', $element);
96+
self::assertSame(1234, $element->getWidth());
9697
}
9798

9899
/**

0 commit comments

Comments
 (0)