Skip to content

Commit

Permalink
cc, as sugggested in box/spout#738 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
quamis authored and Slamdunk committed Mar 10, 2022
1 parent 6700502 commit 57652ec
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/Common/Entity/Row.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Row
* Row height (default is 15)
* @var string
*/
protected $height = "15";
protected $height = '15';

/**
* Row constructor.
Expand Down Expand Up @@ -141,18 +141,19 @@ public function toArray()

/**
* Set row height
* @param String $height
* @param string $height
* @return Row
*/
public function setHeight($height)
{
$this->height = $height;

return $this;
}

/**
* Returns row height
* @return String
* @return string
*/
public function getHeight()
{
Expand Down
3 changes: 2 additions & 1 deletion src/Common/Entity/Style/Style.php
Original file line number Diff line number Diff line change
Expand Up @@ -523,10 +523,11 @@ public function setShouldShrinkToFit($shrinkToFit = true)
{
$this->shrinkToFit = $shrinkToFit;
$this->shouldShrinkToFit = $shrinkToFit;

return $this;
}

/**
/**
* @return bool Whether format should be applied
*/
public function shouldShrinkToFit()
Expand Down
2 changes: 2 additions & 0 deletions src/Common/Manager/OptionsManagerAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public function setOption($optionName, $optionValue)
/**
* Add an option to the internal list of options
* Used only for mergeCells() for now
* @param mixed $optionName
* @param mixed $optionValue
* @return void
*/
public function addOption($optionName, $optionValue)
Expand Down
3 changes: 2 additions & 1 deletion src/Writer/Common/Creator/Style/StyleBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,13 @@ public function setFormat($format)

/**
* Set should shrink to fit
* @param boolean $shrinkToFit
* @param bool $shrinkToFit
* @return void
*/
public function setShouldShrinkToFit($shrinkToFit = true)
{
$this->style->setShouldShrinkToFit($shrinkToFit);

return $this;
}

Expand Down
2 changes: 2 additions & 0 deletions src/Writer/WriterMultiSheetsAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public function setShouldCreateNewSheetsAutomatically($shouldCreateNewSheetsAuto
public function setColumnWidths(array $columnWidths)
{
$this->optionsManager->setOption(Options::COLUMN_WIDTHS, $columnWidths);

return $this;
}

Expand All @@ -75,6 +76,7 @@ public function setColumnWidths(array $columnWidths)
public function mergeCells(array $range1, array $range2)
{
$this->optionsManager->addOption(Options::MERGE_CELLS, [$range1, $range2]);

return $this;
}

Expand Down

0 comments on commit 57652ec

Please sign in to comment.