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