Split Writer EntityFactory into interal and external ones

This commit is contained in:
Adrien Loison committed 2017-11-05 13:04:03 +01:00
1 parent ca5962271e
commit 2d2151ac8d
10 files changed
+83 -72

No files matched your search

@@ -5,7 +5,7 @@ namespace Box\Spout\Writer\XLSX\Creator;
use Box\Spout\Common\Helper\Escaper;
use Box\Spout\Common\Helper\StringHelper;
use Box\Spout\Common\Manager\OptionsManagerInterface;
use Box\Spout\Writer\Common\Creator\EntityFactory;
use Box\Spout\Writer\Common\Creator\InternalEntityFactory;
use Box\Spout\Writer\Common\Entity\Options;
use Box\Spout\Writer\Common\Helper\ZipHelper;
use Box\Spout\Writer\XLSX\Helper\FileSystemHelper;
@@ -18,10 +18,10 @@ class HelperFactory extends \Box\Spout\Common\Creator\HelperFactory
{
/**
* @param OptionsManagerInterface $optionsManager
* @param EntityFactory $entityFactory
* @param InternalEntityFactory $entityFactory
* @return FileSystemHelper
*/
public function createSpecificFileSystemHelper(OptionsManagerInterface $optionsManager, EntityFactory $entityFactory)
public function createSpecificFileSystemHelper(OptionsManagerInterface $optionsManager, InternalEntityFactory $entityFactory)
{
$tempFolder = $optionsManager->getOption(Options::TEMP_FOLDER);
$zipHelper = $this->createZipHelper($entityFactory);
@@ -31,10 +31,10 @@ class HelperFactory extends \Box\Spout\Common\Creator\HelperFactory
}
/**
* @param EntityFactory $entityFactory
* @param InternalEntityFactory $entityFactory
* @return ZipHelper
*/
private function createZipHelper(EntityFactory $entityFactory)
private function createZipHelper(InternalEntityFactory $entityFactory)
{
return new ZipHelper($entityFactory);
}
@@ -3,7 +3,7 @@
namespace Box\Spout\Writer\XLSX\Creator;
use Box\Spout\Common\Manager\OptionsManagerInterface;
use Box\Spout\Writer\Common\Creator\EntityFactory;
use Box\Spout\Writer\Common\Creator\InternalEntityFactory;
use Box\Spout\Writer\Common\Creator\ManagerFactoryInterface;
use Box\Spout\Writer\Common\Entity\Options;
use Box\Spout\Writer\Common\Manager\SheetManager;
@@ -19,17 +19,17 @@ use Box\Spout\Writer\XLSX\Manager\WorksheetManager;
*/
class ManagerFactory implements ManagerFactoryInterface
{
/** @var EntityFactory */
/** @var InternalEntityFactory */
protected $entityFactory;
/** @var HelperFactory $helperFactory */
protected $helperFactory;
/**
* @param EntityFactory $entityFactory
* @param InternalEntityFactory $entityFactory
* @param HelperFactory $helperFactory
*/
public function __construct(EntityFactory $entityFactory, HelperFactory $helperFactory)
public function __construct(InternalEntityFactory $entityFactory, HelperFactory $helperFactory)
{
$this->entityFactory = $entityFactory;
$this->helperFactory = $helperFactory;
@@ -7,7 +7,7 @@ use Box\Spout\Common\Exception\IOException;
use Box\Spout\Common\Helper\Escaper\XLSX as XLSXEscaper;
use Box\Spout\Common\Helper\StringHelper;
use Box\Spout\Common\Manager\OptionsManagerInterface;
use Box\Spout\Writer\Common\Creator\EntityFactory;
use Box\Spout\Writer\Common\Creator\InternalEntityFactory;
use Box\Spout\Writer\Common\Entity\Cell;
use Box\Spout\Writer\Common\Entity\Options;
use Box\Spout\Writer\Common\Entity\Row;
@@ -51,7 +51,7 @@ EOD;
/** @var StringHelper String helper */
private $stringHelper;
/** @var EntityFactory Factory to create entities */
/** @var InternalEntityFactory Factory to create entities */
private $entityFactory;
/**
@@ -62,7 +62,7 @@ EOD;
* @param SharedStringsManager $sharedStringsManager
* @param XLSXEscaper $stringsEscaper
* @param StringHelper $stringHelper
* @param EntityFactory $entityFactory
* @param InternalEntityFactory $entityFactory
*/
public function __construct(
OptionsManagerInterface $optionsManager,
@@ -70,7 +70,7 @@ EOD;
SharedStringsManager $sharedStringsManager,
XLSXEscaper $stringsEscaper,
StringHelper $stringHelper,
EntityFactory $entityFactory
InternalEntityFactory $entityFactory
) {
$this->shouldUseInlineStrings = $optionsManager->getOption(Options::SHOULD_USE_INLINE_STRINGS);
$this->styleManager = $styleManager;