1 | <?php |
||
8 | class PhpSpreadsheetWrapper |
||
9 | { |
||
10 | /** |
||
11 | * @var string |
||
12 | */ |
||
13 | const INSTANCE_KEY = '_tsb'; |
||
14 | |||
15 | /** |
||
16 | * @var DocumentWrapper |
||
17 | */ |
||
18 | private $documentWrapper; |
||
19 | /** |
||
20 | * @var SheetWrapper |
||
21 | */ |
||
22 | private $sheetWrapper; |
||
23 | /** |
||
24 | * @var RowWrapper |
||
25 | */ |
||
26 | private $rowWrapper; |
||
27 | /** |
||
28 | * @var CellWrapper |
||
29 | */ |
||
30 | private $cellWrapper; |
||
31 | /** |
||
32 | * @var HeaderFooterWrapper |
||
33 | */ |
||
34 | private $headerFooterWrapper; |
||
35 | /** |
||
36 | * @var DrawingWrapper |
||
37 | */ |
||
38 | private $drawingWrapper; |
||
39 | |||
40 | /** |
||
41 | * @var int|null |
||
42 | */ |
||
43 | private $cellIndex; |
||
44 | /** |
||
45 | * @var int|null |
||
46 | */ |
||
47 | private $rowIndex; |
||
48 | |||
49 | /** |
||
50 | * PhpSpreadsheetWrapper constructor. |
||
51 | * |
||
52 | * @param array $context |
||
53 | * @param \Twig_Environment $environment |
||
54 | * @param array $attributes |
||
55 | */ |
||
56 | 112 | public function __construct(array $context, \Twig_Environment $environment, array $attributes = []) |
|
65 | |||
66 | /** |
||
67 | * @param array $context |
||
68 | * |
||
69 | * @return array |
||
70 | */ |
||
71 | 100 | public static function fixContext(array $context): array |
|
87 | |||
88 | /** |
||
89 | * @param array $properties |
||
90 | * |
||
91 | * @throws \PhpOffice\PhpSpreadsheet\Exception |
||
92 | * @throws \PhpOffice\PhpSpreadsheet\Reader\Exception |
||
93 | * @throws \RuntimeException |
||
94 | */ |
||
95 | 112 | public function startDocument(array $properties = []) |
|
99 | |||
100 | /** |
||
101 | * @throws \LogicException |
||
102 | * @throws \InvalidArgumentException |
||
103 | * @throws \PhpOffice\PhpSpreadsheet\Exception |
||
104 | * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception |
||
105 | * @throws \Symfony\Component\Filesystem\Exception\IOException |
||
106 | */ |
||
107 | 104 | public function endDocument() |
|
111 | |||
112 | /** |
||
113 | * @param int|string|null $index |
||
114 | * @param array $properties |
||
115 | * |
||
116 | * @throws \LogicException |
||
117 | * @throws \PhpOffice\PhpSpreadsheet\Exception |
||
118 | * @throws \RuntimeException |
||
119 | */ |
||
120 | 100 | public function startSheet($index = null, array $properties = []) |
|
124 | |||
125 | /** |
||
126 | * @throws \LogicException |
||
127 | * @throws \Exception |
||
128 | */ |
||
129 | 92 | public function endSheet() |
|
133 | |||
134 | /** |
||
135 | * @throws \LogicException |
||
136 | */ |
||
137 | 77 | public function startRow() |
|
141 | |||
142 | /** |
||
143 | * @throws \LogicException |
||
144 | */ |
||
145 | 73 | public function endRow() |
|
149 | |||
150 | /** |
||
151 | * @param null|mixed $value |
||
152 | * @param array $properties |
||
153 | * |
||
154 | * @throws \InvalidArgumentException |
||
155 | * @throws \LogicException |
||
156 | * @throws \PhpOffice\PhpSpreadsheet\Exception |
||
157 | * @throws \RuntimeException |
||
158 | */ |
||
159 | 73 | public function startCell($value = null, array $properties = []) |
|
163 | |||
164 | 73 | public function endCell() |
|
168 | |||
169 | /** |
||
170 | * @param string $baseType |
||
171 | * @param string|null $type |
||
172 | * @param array $properties |
||
173 | * |
||
174 | * @throws \LogicException |
||
175 | * @throws \RuntimeException |
||
176 | * @throws \InvalidArgumentException |
||
177 | */ |
||
178 | 5 | public function startHeaderFooter(string $baseType, string $type = null, array $properties = []) |
|
182 | |||
183 | /** |
||
184 | * @throws \LogicException |
||
185 | * @throws \InvalidArgumentException |
||
186 | */ |
||
187 | 5 | public function endHeaderFooter() |
|
191 | |||
192 | /** |
||
193 | * @param null|string $type |
||
194 | * @param array $properties |
||
195 | * |
||
196 | * @throws \InvalidArgumentException |
||
197 | * @throws \LogicException |
||
198 | */ |
||
199 | 5 | public function startAlignment(string $type = null, array $properties = []) |
|
203 | |||
204 | /** |
||
205 | * @param null|string $value |
||
206 | * |
||
207 | * @throws \InvalidArgumentException |
||
208 | * @throws \LogicException |
||
209 | */ |
||
210 | 5 | public function endAlignment(string $value = null) |
|
214 | |||
215 | /** |
||
216 | * @param string $path |
||
217 | * @param array $properties |
||
218 | * |
||
219 | * @throws \Symfony\Component\Filesystem\Exception\IOException |
||
220 | * @throws \InvalidArgumentException |
||
221 | * @throws \LogicException |
||
222 | * @throws \RuntimeException |
||
223 | * @throws \PhpOffice\PhpSpreadsheet\Exception |
||
224 | */ |
||
225 | 6 | public function startDrawing(string $path, array $properties = []) |
|
229 | |||
230 | 6 | public function endDrawing() |
|
234 | |||
235 | /** |
||
236 | * @return int|null |
||
237 | */ |
||
238 | public function getCellIndex() |
||
242 | |||
243 | /** |
||
244 | * @param int|null $cellIndex |
||
245 | */ |
||
246 | 73 | public function setCellIndex(int $cellIndex = null) |
|
250 | |||
251 | /** |
||
252 | * @return int|null |
||
253 | */ |
||
254 | 77 | public function getRowIndex() |
|
258 | |||
259 | /** |
||
260 | * @param int|null $rowIndex |
||
261 | */ |
||
262 | 77 | public function setRowIndex(int $rowIndex = null) |
|
266 | } |
||
267 |