Random DI improvements (#458)
* Add random DI improvements Fixing things that were previously missed * Split InternalFactory into Manager and Helper factories
This commit is contained in:
1 parent
b7e46740ce
commit
4ec3a21170
19 files changed
+317
-183
No files matched your search
@@ -5,6 +5,7 @@ namespace Box\Spout\Writer\XLSX\Manager;
|
||||
use Box\Spout\Common\Exception\InvalidArgumentException;
|
||||
use Box\Spout\Common\Exception\IOException;
|
||||
use Box\Spout\Common\Helper\StringHelper;
|
||||
use Box\Spout\Writer\Common\Creator\EntityFactory;
|
||||
use Box\Spout\Writer\Common\Helper\CellHelper;
|
||||
use Box\Spout\Common\Manager\OptionsManagerInterface;
|
||||
use Box\Spout\Writer\Common\Entity\Options;
|
||||
@@ -50,6 +51,9 @@ EOD;
|
||||
/** @var StringHelper String helper */
|
||||
private $stringHelper;
|
||||
|
||||
/** @var EntityFactory Factory to create entities */
|
||||
private $entityFactory;
|
||||
|
||||
/**
|
||||
* WorksheetManager constructor.
|
||||
*
|
||||
@@ -58,19 +62,22 @@ EOD;
|
||||
* @param SharedStringsManager $sharedStringsManager
|
||||
* @param \Box\Spout\Common\Helper\Escaper\XLSX $stringsEscaper
|
||||
* @param StringHelper $stringHelper
|
||||
* @param EntityFactory $entityFactory
|
||||
*/
|
||||
public function __construct(
|
||||
OptionsManagerInterface $optionsManager,
|
||||
StyleManager $styleManager,
|
||||
SharedStringsManager $sharedStringsManager,
|
||||
\Box\Spout\Common\Helper\Escaper\XLSX $stringsEscaper,
|
||||
StringHelper $stringHelper)
|
||||
StringHelper $stringHelper,
|
||||
EntityFactory $entityFactory)
|
||||
{
|
||||
$this->shouldUseInlineStrings = $optionsManager->getOption(Options::SHOULD_USE_INLINE_STRINGS);
|
||||
$this->styleManager = $styleManager;
|
||||
$this->sharedStringsManager = $sharedStringsManager;
|
||||
$this->stringsEscaper = $stringsEscaper;
|
||||
$this->stringHelper = $stringHelper;
|
||||
$this->entityFactory = $entityFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -200,7 +207,7 @@ EOD;
|
||||
if ($cellValue instanceof Cell) {
|
||||
$cell = $cellValue;
|
||||
} else {
|
||||
$cell = new Cell($cellValue);
|
||||
$cell = $this->entityFactory->createCell($cellValue);
|
||||
}
|
||||
|
||||
if ($cell->isString()) {
|
||||
|
||||
Reference in new issue
Block a user