Fix code style
This commit is contained in:
1 parent
740fcfb8c1
commit
b968513cb9
171 files changed
+517
-792
No files matched your search
@@ -4,23 +4,21 @@ namespace Box\Spout\Writer\Common\Manager;
|
||||
|
||||
use Box\Spout\Common\Exception\IOException;
|
||||
use Box\Spout\Common\Manager\OptionsManagerInterface;
|
||||
use Box\Spout\Writer\Common\Creator\EntityFactory;
|
||||
use Box\Spout\Writer\Common\Creator\ManagerFactoryInterface;
|
||||
use Box\Spout\Writer\Common\Helper\FileSystemWithRootFolderHelperInterface;
|
||||
use Box\Spout\Writer\Common\Entity\Options;
|
||||
use Box\Spout\Writer\Common\Manager\Style\StyleManagerInterface;
|
||||
use Box\Spout\Writer\Common\Entity\Sheet;
|
||||
use Box\Spout\Writer\Common\Entity\Style\Style;
|
||||
use Box\Spout\Writer\Common\Entity\Workbook;
|
||||
use Box\Spout\Writer\Common\Entity\Worksheet;
|
||||
use Box\Spout\Writer\Common\Helper\FileSystemWithRootFolderHelperInterface;
|
||||
use Box\Spout\Writer\Common\Manager\Style\StyleManagerInterface;
|
||||
use Box\Spout\Writer\Exception\SheetNotFoundException;
|
||||
use Box\Spout\Writer\Exception\WriterException;
|
||||
use Box\Spout\Writer\Common\Creator\EntityFactory;
|
||||
use Box\Spout\Writer\Common\Entity\Style\Style;
|
||||
|
||||
/**
|
||||
* Class WorkbookManagerAbstract
|
||||
* Abstract workbook manager, providing the generic interfaces to work with workbook.
|
||||
*
|
||||
* @package Box\Spout\Writer\Common\Manager
|
||||
*/
|
||||
abstract class WorkbookManagerAbstract implements WorkbookManagerInterface
|
||||
{
|
||||
@@ -48,7 +46,6 @@ abstract class WorkbookManagerAbstract implements WorkbookManagerInterface
|
||||
/** @var Worksheet The worksheet where data will be written to */
|
||||
protected $currentWorksheet;
|
||||
|
||||
|
||||
/**
|
||||
* @param Workbook $workbook
|
||||
* @param OptionsManagerInterface $optionsManager
|
||||
@@ -65,8 +62,8 @@ abstract class WorkbookManagerAbstract implements WorkbookManagerInterface
|
||||
StyleManagerInterface $styleManager,
|
||||
FileSystemWithRootFolderHelperInterface $fileSystemHelper,
|
||||
EntityFactory $entityFactory,
|
||||
ManagerFactoryInterface $managerFactory)
|
||||
{
|
||||
ManagerFactoryInterface $managerFactory
|
||||
) {
|
||||
$this->workbook = $workbook;
|
||||
$this->optionManager = $optionsManager;
|
||||
$this->worksheetManager = $worksheetManager;
|
||||
@@ -99,8 +96,8 @@ abstract class WorkbookManagerAbstract implements WorkbookManagerInterface
|
||||
* Creates a new sheet in the workbook and make it the current sheet.
|
||||
* The writing will resume where it stopped (i.e. data won't be truncated).
|
||||
*
|
||||
* @return Worksheet The created sheet
|
||||
* @throws IOException If unable to open the sheet for writing
|
||||
* @return Worksheet The created sheet
|
||||
*/
|
||||
public function addNewSheetAndMakeItCurrent()
|
||||
{
|
||||
@@ -113,8 +110,8 @@ abstract class WorkbookManagerAbstract implements WorkbookManagerInterface
|
||||
/**
|
||||
* Creates a new sheet in the workbook. The current sheet remains unchanged.
|
||||
*
|
||||
* @return Worksheet The created sheet
|
||||
* @throws \Box\Spout\Common\Exception\IOException If unable to open the sheet for writing
|
||||
* @return Worksheet The created sheet
|
||||
*/
|
||||
private function addNewSheet()
|
||||
{
|
||||
@@ -158,8 +155,8 @@ abstract class WorkbookManagerAbstract implements WorkbookManagerInterface
|
||||
* The writing will resume where it stopped (i.e. data won't be truncated).
|
||||
*
|
||||
* @param Sheet $sheet The "external" sheet to set as current
|
||||
* @return void
|
||||
* @throws SheetNotFoundException If the given sheet does not exist in the workbook
|
||||
* @return void
|
||||
*/
|
||||
public function setCurrentSheet(Sheet $sheet)
|
||||
{
|
||||
@@ -208,9 +205,9 @@ abstract class WorkbookManagerAbstract implements WorkbookManagerInterface
|
||||
* @param array $dataRow Array containing data to be written. Cannot be empty.
|
||||
* Example $dataRow = ['data1', 1234, null, '', 'data5'];
|
||||
* @param Style $style Style to be applied to the row.
|
||||
* @return void
|
||||
* @throws IOException If trying to create a new sheet and unable to open the sheet for writing
|
||||
* @throws WriterException If unable to write data
|
||||
* @return void
|
||||
*/
|
||||
public function addRowToCurrentWorksheet($dataRow, Style $style)
|
||||
{
|
||||
@@ -238,6 +235,7 @@ abstract class WorkbookManagerAbstract implements WorkbookManagerInterface
|
||||
private function hasCurrentWorkseetReachedMaxRows()
|
||||
{
|
||||
$currentWorksheet = $this->getCurrentWorksheet();
|
||||
|
||||
return ($currentWorksheet->getLastWrittenRowIndex() >= $this->getMaxRowsPerWorksheet());
|
||||
}
|
||||
|
||||
@@ -248,8 +246,8 @@ abstract class WorkbookManagerAbstract implements WorkbookManagerInterface
|
||||
* @param array $dataRow Array containing data to be written. Cannot be empty.
|
||||
* Example $dataRow = ['data1', 1234, null, '', 'data5'];
|
||||
* @param Style $style Style to be applied to the row.
|
||||
* @return void
|
||||
* @throws WriterException If unable to write data
|
||||
* @return void
|
||||
*/
|
||||
private function addRowWithStyleToWorksheet(Worksheet $worksheet, $dataRow, Style $style)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user