Move Style classes into Common folder (#432)

This commit is contained in:
Adrien Loison authored and GitHub committed 2017-05-30 00:56:50 +02:00
1 parent c4e25a168e
commit 238756ab6e
38 files changed
+463 -298

No files matched your search

@@ -7,6 +7,7 @@ use Box\Spout\Writer\Common\Manager\OptionsManagerInterface;
use Box\Spout\Writer\Common\Entity\Options;
use Box\Spout\Writer\Common\Creator\EntityFactory;
use Box\Spout\Writer\Common\Creator\InternalFactoryInterface;
use Box\Spout\Writer\Common\Manager\StyleManager;
use Box\Spout\Writer\ODS\Helper\FileSystemHelper;
use Box\Spout\Writer\ODS\Helper\StyleHelper;
use Box\Spout\Writer\ODS\Manager\WorkbookManager;
@@ -80,7 +81,17 @@ class InternalFactory implements InternalFactoryInterface
private function createStyleHelper(OptionsManagerInterface $optionsManager)
{
$defaultRowStyle = $optionsManager->getOption(Options::DEFAULT_ROW_STYLE);
return new StyleHelper($defaultRowStyle);
$styleManager = $this->createStyleManager();
return new StyleHelper($defaultRowStyle, $styleManager);
}
/**
* @return StyleManager
*/
private function createStyleManager()
{
return new StyleManager();
}
/**
+2 -2
View File
@@ -2,8 +2,8 @@
namespace Box\Spout\Writer\ODS\Helper;
use Box\Spout\Writer\Style\BorderPart;
use Box\Spout\Writer\Style\Border;
use Box\Spout\Writer\Common\Entity\Style\BorderPart;
use Box\Spout\Writer\Common\Entity\Style\Border;
/**
* Class BorderHelper
+9 -9
View File
@@ -3,7 +3,7 @@
namespace Box\Spout\Writer\ODS\Helper;
use Box\Spout\Writer\Common\Helper\StyleHelperAbstract;
use Box\Spout\Writer\Style\BorderPart;
use Box\Spout\Writer\Common\Entity\Style\BorderPart;
/**
* Class StyleHelper
@@ -20,8 +20,8 @@ class StyleHelper extends StyleHelperAbstract
* Registers the given style as a used style.
* Duplicate styles won't be registered more than once.
*
* @param \Box\Spout\Writer\Style\Style $style The style to be registered
* @return \Box\Spout\Writer\Style\Style The registered style, updated with an internal ID.
* @param \Box\Spout\Writer\Common\Entity\Style\Style $style The style to be registered
* @return \Box\Spout\Writer\Common\Entity\Style\Style The registered style, updated with an internal ID.
*/
public function registerStyle($style)
{
@@ -209,7 +209,7 @@ EOD;
/**
* Returns the contents of the "<style:style>" section, inside "<office:automatic-styles>" section
*
* @param \Box\Spout\Writer\Style\Style $style
* @param \Box\Spout\Writer\Common\Entity\Style\Style $style
* @return string
*/
protected function getStyleSectionContent($style)
@@ -229,7 +229,7 @@ EOD;
/**
* Returns the contents of the "<style:text-properties>" section, inside "<style:style>" section
*
* @param \Box\Spout\Writer\Style\Style $style
* @param \Box\Spout\Writer\Common\Entity\Style\Style $style
* @return string
*/
private function getTextPropertiesSectionContent($style)
@@ -246,7 +246,7 @@ EOD;
/**
* Returns the contents of the "<style:text-properties>" section, inside "<style:style>" section
*
* @param \Box\Spout\Writer\Style\Style $style
* @param \Box\Spout\Writer\Common\Entity\Style\Style $style
* @return string
*/
private function getFontSectionContent($style)
@@ -291,7 +291,7 @@ EOD;
/**
* Returns the contents of the "<style:table-cell-properties>" section, inside "<style:style>" section
*
* @param \Box\Spout\Writer\Style\Style $style
* @param \Box\Spout\Writer\Common\Entity\Style\Style $style
* @return string
*/
private function getTableCellPropertiesSectionContent($style)
@@ -326,7 +326,7 @@ EOD;
/**
* Returns the contents of the borders definition for the "<style:table-cell-properties>" section
*
* @param \Box\Spout\Writer\Style\Style $style
* @param \Box\Spout\Writer\Common\Entity\Style\Style $style
* @return string
*/
private function getBorderXMLContent($style)
@@ -343,7 +343,7 @@ EOD;
/**
* Returns the contents of the background color definition for the "<style:table-cell-properties>" section
*
* @param \Box\Spout\Writer\Style\Style $style
* @param \Box\Spout\Writer\Common\Entity\Style\Style $style
* @return string
*/
private function getBackgroundColorXMLContent($style)
@@ -4,7 +4,7 @@ namespace Box\Spout\Writer\ODS\Manager;
use Box\Spout\Writer\Common\Entity\Options;
use Box\Spout\Writer\Common\Manager\OptionsManagerAbstract;
use Box\Spout\Writer\Style\StyleBuilder;
use Box\Spout\Writer\Common\Creator\Style\StyleBuilder;
/**
* Class OptionsManager
@@ -9,7 +9,7 @@ use Box\Spout\Writer\Common\Entity\Cell;
use Box\Spout\Writer\Common\Entity\Worksheet;
use Box\Spout\Writer\Common\Manager\WorksheetManagerInterface;
use Box\Spout\Writer\ODS\Helper\StyleHelper;
use Box\Spout\Writer\Style\Style;
use Box\Spout\Writer\Common\Entity\Style\Style;
/**
* Class WorksheetManager