Skip to content

Commit 7601a3e

Browse files
authored
Fixed some typehint
1 parent 831c1bc commit 7601a3e

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/PhpWord/Style/Cell.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class Cell extends Border
123123
*
124124
* @var bool
125125
*/
126-
private $noWrap;
126+
private $noWrap = true;
127127

128128
/**
129129
* Get vertical align.
@@ -323,9 +323,10 @@ public function setUnit($value)
323323
/**
324324
* Set noWrap.
325325
*
326-
* @param $value
326+
* @param bool $value
327+
* @return self
327328
*/
328-
public function setNoWrap($value)
329+
public function setNoWrap(bool $value): self
329330
{
330331
$this->noWrap = $this->setBoolVal($value, true);
331332

@@ -337,7 +338,7 @@ public function setNoWrap($value)
337338
*
338339
* @return bool
339340
*/
340-
public function getNoWrap()
341+
public function getNoWrap(): bool
341342
{
342343
return $this->noWrap;
343344
}

src/PhpWord/Writer/Word2007/Style/Cell.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,7 @@ public function write(): void
8888
$vMerge = $style->getVMerge();
8989
$xmlWriter->writeElementIf(null !== $gridSpan, 'w:gridSpan', 'w:val', $gridSpan);
9090
$xmlWriter->writeElementIf(null !== $vMerge, 'w:vMerge', 'w:val', $vMerge);
91-
92-
// noWrap
93-
$noWrap = $style->getNoWrap();
94-
$xmlWriter->writeElementIf(true === $noWrap, 'w:noWrap');
91+
$xmlWriter->writeElementIf($style->getNoWrap(), 'w:noWrap');
9592

9693
$xmlWriter->endElement(); // w:tcPr
9794
}

0 commit comments

Comments
 (0)