1 | <?php |
||
17 | abstract class WriterMultiSheetsAbstract extends WriterAbstract |
||
18 | { |
||
19 | |||
20 | /** @var InternalFactoryInterface */ |
||
21 | private $internalFactory; |
||
22 | |||
23 | /** @var WorkbookManagerInterface */ |
||
24 | private $workbookManager; |
||
25 | |||
26 | /** |
||
27 | * @param OptionsManagerInterface $optionsManager |
||
28 | * @param InternalFactoryInterface $internalFactory |
||
29 | */ |
||
30 | 99 | public function __construct(OptionsManagerInterface $optionsManager, InternalFactoryInterface $internalFactory) |
|
35 | |||
36 | /** |
||
37 | * Sets whether new sheets should be automatically created when the max rows limit per sheet is reached. |
||
38 | * This must be set before opening the writer. |
||
39 | * |
||
40 | * @api |
||
41 | * @param bool $shouldCreateNewSheetsAutomatically Whether new sheets should be automatically created when the max rows limit per sheet is reached |
||
42 | * @return WriterMultiSheetsAbstract |
||
43 | * @throws \Box\Spout\Writer\Exception\WriterAlreadyOpenedException If the writer was already opened |
||
44 | */ |
||
45 | 35 | public function setShouldCreateNewSheetsAutomatically($shouldCreateNewSheetsAutomatically) |
|
52 | |||
53 | /** |
||
54 | * Configures the write and sets the current sheet pointer to a new sheet. |
||
55 | * |
||
56 | * @return void |
||
57 | * @throws \Box\Spout\Common\Exception\IOException If unable to open the file for writing |
||
58 | */ |
||
59 | 89 | protected function openWriter() |
|
66 | |||
67 | /** |
||
68 | * Returns all the workbook's sheets |
||
69 | * |
||
70 | * @api |
||
71 | * @return Common\Sheet[] All the workbook's sheets |
||
72 | * @throws \Box\Spout\Writer\Exception\WriterNotOpenedException If the writer has not been opened yet |
||
73 | */ |
||
74 | 14 | public function getSheets() |
|
88 | |||
89 | /** |
||
90 | * Creates a new sheet and make it the current sheet. The data will now be written to this sheet. |
||
91 | * |
||
92 | * @api |
||
93 | * @return Common\Sheet The created sheet |
||
94 | * @throws \Box\Spout\Writer\Exception\WriterNotOpenedException If the writer has not been opened yet |
||
95 | */ |
||
96 | 15 | public function addNewSheetAndMakeItCurrent() |
|
103 | |||
104 | /** |
||
105 | * Returns the current sheet |
||
106 | * |
||
107 | * @api |
||
108 | * @return Common\Sheet The current sheet |
||
109 | * @throws \Box\Spout\Writer\Exception\WriterNotOpenedException If the writer has not been opened yet |
||
110 | */ |
||
111 | 8 | public function getCurrentSheet() |
|
116 | |||
117 | /** |
||
118 | * Sets the given sheet as the current one. New data will be written to this sheet. |
||
119 | * The writing will resume where it stopped (i.e. data won't be truncated). |
||
120 | * |
||
121 | * @api |
||
122 | * @param Common\Sheet $sheet The sheet to set as current |
||
123 | * @return void |
||
124 | * @throws \Box\Spout\Writer\Exception\WriterNotOpenedException If the writer has not been opened yet |
||
125 | * @throws \Box\Spout\Writer\Exception\SheetNotFoundException If the given sheet does not exist in the workbook |
||
126 | */ |
||
127 | 4 | public function setCurrentSheet($sheet) |
|
132 | |||
133 | /** |
||
134 | * Checks if the workbook has been created. Throws an exception if not created yet. |
||
135 | * |
||
136 | * @return void |
||
137 | * @throws \Box\Spout\Writer\Exception\WriterNotOpenedException If the workbook is not created yet |
||
138 | */ |
||
139 | 70 | protected function throwIfWorkbookIsNotAvailable() |
|
145 | |||
146 | /** |
||
147 | * Adds data to the currently opened writer. |
||
148 | * If shouldCreateNewSheetsAutomatically option is set to true, it will handle pagination |
||
149 | * with the creation of new worksheets if one worksheet has reached its maximum capicity. |
||
150 | * |
||
151 | * @param array $dataRow Array containing data to be written. |
||
152 | * Example $dataRow = ['data1', 1234, null, '', 'data5']; |
||
153 | * @param \Box\Spout\Writer\Style\Style $style Style to be applied to the row. |
||
154 | * @return void |
||
155 | * @throws \Box\Spout\Writer\Exception\WriterNotOpenedException If the book is not created yet |
||
156 | * @throws \Box\Spout\Common\Exception\IOException If unable to write data |
||
157 | */ |
||
158 | 64 | protected function addRowToWriter(array $dataRow, $style) |
|
163 | |||
164 | /** |
||
165 | * Closes the writer, preventing any additional writing. |
||
166 | * |
||
167 | * @return void |
||
168 | */ |
||
169 | 70 | protected function closeWriter() |
|
175 | } |
||
176 | |||
177 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..