some cleanup todos
This commit is contained in:
parent
99c327ba84
commit
edccd21dbd
@ -70,15 +70,12 @@ class Cell
|
|||||||
/**
|
/**
|
||||||
* Cell constructor.
|
* Cell constructor.
|
||||||
* @param $value mixed
|
* @param $value mixed
|
||||||
* @param $style Style
|
* @param $style|null Style
|
||||||
*/
|
*/
|
||||||
public function __construct($value, Style $style = null)
|
public function __construct($value, Style $style = null)
|
||||||
{
|
{
|
||||||
$this->setValue($value);
|
$this->setValue($value);
|
||||||
if ($style) {
|
$this->setStyle($style);
|
||||||
$this->setStyle($style);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->styleMerger = new StyleMerger();
|
$this->styleMerger = new StyleMerger();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,7 +105,7 @@ class Cell
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Style
|
* @return Style|null
|
||||||
*/
|
*/
|
||||||
public function getStyle()
|
public function getStyle()
|
||||||
{
|
{
|
||||||
@ -205,15 +202,15 @@ class Cell
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Style $style|null
|
* @param Style $style|null
|
||||||
* @return $this
|
* @return Cell
|
||||||
*/
|
*/
|
||||||
public function applyStyle(Style $style = null)
|
public function applyStyle(Style $style = null)
|
||||||
{
|
{
|
||||||
if ($style === null) {
|
if ($style === null) {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
$merged = $this->styleMerger->merge($this->getStyle(), $style);
|
$mergedStyle = $this->styleMerger->merge($this->getStyle(), $style);
|
||||||
$this->setStyle($merged);
|
$this->setStyle($mergedStyle);
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -119,6 +119,7 @@ class WorksheetManager implements WorksheetManagerInterface
|
|||||||
/** @var Cell|null $nextCell */
|
/** @var Cell|null $nextCell */
|
||||||
$nextCell = isset($cells[$nextCellIndex]) ? $cells[$nextCellIndex] : null;
|
$nextCell = isset($cells[$nextCellIndex]) ? $cells[$nextCellIndex] : null;
|
||||||
|
|
||||||
|
// @TODO refactoring: move this to its own method
|
||||||
if (null === $nextCell || $cell->getValue() !== $nextCell->getValue()) {
|
if (null === $nextCell || $cell->getValue() !== $nextCell->getValue()) {
|
||||||
|
|
||||||
// Apply styles - the row style is merged at this point
|
// Apply styles - the row style is merged at this point
|
||||||
|
@ -149,6 +149,7 @@ EOD;
|
|||||||
|
|
||||||
$rowXML = '<row r="' . $rowIndex . '" spans="1:' . $numCells . '">';
|
$rowXML = '<row r="' . $rowIndex . '" spans="1:' . $numCells . '">';
|
||||||
|
|
||||||
|
// @TODO refactoring: move this to its own method
|
||||||
/** @var Cell $cell */
|
/** @var Cell $cell */
|
||||||
foreach($row->getCells() as $cell) {
|
foreach($row->getCells() as $cell) {
|
||||||
// Apply styles - the row style is merged at this point
|
// Apply styles - the row style is merged at this point
|
||||||
|
Loading…
x
Reference in New Issue
Block a user