StyleMerger and RowManager changes

Move DI of StyleMerger to get rid of business logic in the entities Cell and Row
Simplify RowManager
This commit is contained in:
Adrien Loison committed 2017-11-10 22:45:57 +01:00
1 parent 111f82d35f
commit ddfa40e8b3
10 files changed
+67 -166

No files matched your search

@@ -3,7 +3,6 @@
namespace Box\Spout\Writer\Common\Manager;
use Box\Spout\Writer\Common\Entity\Row;
use Box\Spout\Writer\Common\Entity\Style\Style;
use Box\Spout\Writer\Common\Manager\Style\StyleMerger;
class RowManager
@@ -21,28 +20,6 @@ class RowManager
$this->styleMerger = $styleMerger;
}
/**
* @param Row $row
* @param Style $style
* @return $this
*/
public function applyStyle(Row $row, Style $style)
{
$mergedStyle = $this->styleMerger->merge($row->getStyle(), $style);
$row->setStyle($mergedStyle);
}
/**
* Returns whether a row has cells
*
* @param Row $row
* @return bool
*/
public function hasCells(Row $row)
{
return count($row->getCells()) !== 0;
}
/**
* Detect whether a row is considered empty.
* An empty row has either no cells at all - or only one empty cell