@@ -82,173 +82,171 @@ discard block |
||
82 | 82 | |
83 | 83 | protected function initializeMappings() |
84 | 84 | { |
85 | - $this->mappings['autoFilter'] = function ($value) { |
|
85 | + $this->mappings['autoFilter'] = function($value) { |
|
86 | 86 | $this->object->setAutoFilter($value); |
87 | 87 | }; |
88 | - $this->mappings['columnDimension']['__multi'] = function ($column = 'default'): ColumnDimension { |
|
88 | + $this->mappings['columnDimension']['__multi'] = function($column = 'default'): ColumnDimension { |
|
89 | 89 | return $column === 'default' ? |
90 | - $this->object->getDefaultColumnDimension() : |
|
91 | - $this->object->getColumnDimension($column); |
|
90 | + $this->object->getDefaultColumnDimension() : $this->object->getColumnDimension($column); |
|
92 | 91 | }; |
93 | - $this->mappings['columnDimension']['autoSize'] = function ($value, ColumnDimension $object) { |
|
92 | + $this->mappings['columnDimension']['autoSize'] = function($value, ColumnDimension $object) { |
|
94 | 93 | $object->setAutoSize($value); |
95 | 94 | }; |
96 | - $this->mappings['columnDimension']['collapsed'] = function ($value, ColumnDimension $object) { |
|
95 | + $this->mappings['columnDimension']['collapsed'] = function($value, ColumnDimension $object) { |
|
97 | 96 | $object->setCollapsed($value); |
98 | 97 | }; |
99 | - $this->mappings['columnDimension']['columnIndex'] = function ($value, ColumnDimension $object) { |
|
98 | + $this->mappings['columnDimension']['columnIndex'] = function($value, ColumnDimension $object) { |
|
100 | 99 | $object->setColumnIndex($value); |
101 | 100 | }; |
102 | - $this->mappings['columnDimension']['outlineLevel'] = function ($value, ColumnDimension $object) { |
|
101 | + $this->mappings['columnDimension']['outlineLevel'] = function($value, ColumnDimension $object) { |
|
103 | 102 | $object->setOutlineLevel($value); |
104 | 103 | }; |
105 | - $this->mappings['columnDimension']['visible'] = function ($value, ColumnDimension $object) { |
|
104 | + $this->mappings['columnDimension']['visible'] = function($value, ColumnDimension $object) { |
|
106 | 105 | $object->setVisible($value); |
107 | 106 | }; |
108 | - $this->mappings['columnDimension']['width'] = function ($value, ColumnDimension $object) { |
|
107 | + $this->mappings['columnDimension']['width'] = function($value, ColumnDimension $object) { |
|
109 | 108 | $object->setWidth($value); |
110 | 109 | }; |
111 | - $this->mappings['columnDimension']['xfIndex'] = function ($value, ColumnDimension $object) { |
|
110 | + $this->mappings['columnDimension']['xfIndex'] = function($value, ColumnDimension $object) { |
|
112 | 111 | $object->setXfIndex($value); |
113 | 112 | }; |
114 | - $this->mappings['pageMargins']['top'] = function ($value) { |
|
113 | + $this->mappings['pageMargins']['top'] = function($value) { |
|
115 | 114 | $this->object->getPageMargins()->setTop($value); |
116 | 115 | }; |
117 | - $this->mappings['pageMargins']['bottom'] = function ($value) { |
|
116 | + $this->mappings['pageMargins']['bottom'] = function($value) { |
|
118 | 117 | $this->object->getPageMargins()->setBottom($value); |
119 | 118 | }; |
120 | - $this->mappings['pageMargins']['left'] = function ($value) { |
|
119 | + $this->mappings['pageMargins']['left'] = function($value) { |
|
121 | 120 | $this->object->getPageMargins()->setLeft($value); |
122 | 121 | }; |
123 | - $this->mappings['pageMargins']['right'] = function ($value) { |
|
122 | + $this->mappings['pageMargins']['right'] = function($value) { |
|
124 | 123 | $this->object->getPageMargins()->setRight($value); |
125 | 124 | }; |
126 | - $this->mappings['pageMargins']['header'] = function ($value) { |
|
125 | + $this->mappings['pageMargins']['header'] = function($value) { |
|
127 | 126 | $this->object->getPageMargins()->setHeader($value); |
128 | 127 | }; |
129 | - $this->mappings['pageMargins']['footer'] = function ($value) { |
|
128 | + $this->mappings['pageMargins']['footer'] = function($value) { |
|
130 | 129 | $this->object->getPageMargins()->setFooter($value); |
131 | 130 | }; |
132 | - $this->mappings['pageSetup']['fitToHeight'] = function ($value) { |
|
131 | + $this->mappings['pageSetup']['fitToHeight'] = function($value) { |
|
133 | 132 | $this->object->getPageSetup()->setFitToHeight($value); |
134 | 133 | }; |
135 | - $this->mappings['pageSetup']['fitToPage'] = function ($value) { |
|
134 | + $this->mappings['pageSetup']['fitToPage'] = function($value) { |
|
136 | 135 | $this->object->getPageSetup()->setFitToPage($value); |
137 | 136 | }; |
138 | - $this->mappings['pageSetup']['fitToWidth'] = function ($value) { |
|
137 | + $this->mappings['pageSetup']['fitToWidth'] = function($value) { |
|
139 | 138 | $this->object->getPageSetup()->setFitToWidth($value); |
140 | 139 | }; |
141 | - $this->mappings['pageSetup']['horizontalCentered'] = function ($value) { |
|
140 | + $this->mappings['pageSetup']['horizontalCentered'] = function($value) { |
|
142 | 141 | $this->object->getPageSetup()->setHorizontalCentered($value); |
143 | 142 | }; |
144 | - $this->mappings['pageSetup']['orientation'] = function ($value) { |
|
143 | + $this->mappings['pageSetup']['orientation'] = function($value) { |
|
145 | 144 | $this->object->getPageSetup()->setOrientation($value); |
146 | 145 | }; |
147 | - $this->mappings['pageSetup']['paperSize'] = function ($value) { |
|
146 | + $this->mappings['pageSetup']['paperSize'] = function($value) { |
|
148 | 147 | $this->object->getPageSetup()->setPaperSize($value); |
149 | 148 | }; |
150 | - $this->mappings['pageSetup']['printArea'] = function ($value) { |
|
149 | + $this->mappings['pageSetup']['printArea'] = function($value) { |
|
151 | 150 | $this->object->getPageSetup()->setPrintArea($value); |
152 | 151 | }; |
153 | - $this->mappings['pageSetup']['scale'] = function ($value) { |
|
152 | + $this->mappings['pageSetup']['scale'] = function($value) { |
|
154 | 153 | $this->object->getPageSetup()->setScale($value); |
155 | 154 | }; |
156 | - $this->mappings['pageSetup']['verticalCentered'] = function ($value) { |
|
155 | + $this->mappings['pageSetup']['verticalCentered'] = function($value) { |
|
157 | 156 | $this->object->getPageSetup()->setVerticalCentered($value); |
158 | 157 | }; |
159 | - $this->mappings['printGridlines'] = function ($value) { |
|
158 | + $this->mappings['printGridlines'] = function($value) { |
|
160 | 159 | $this->object->setPrintGridlines($value); |
161 | 160 | }; |
162 | - $this->mappings['protection']['autoFilter'] = function ($value) { |
|
161 | + $this->mappings['protection']['autoFilter'] = function($value) { |
|
163 | 162 | $this->object->getProtection()->setAutoFilter($value); |
164 | 163 | }; |
165 | - $this->mappings['protection']['deleteColumns'] = function ($value) { |
|
164 | + $this->mappings['protection']['deleteColumns'] = function($value) { |
|
166 | 165 | $this->object->getProtection()->setDeleteColumns($value); |
167 | 166 | }; |
168 | - $this->mappings['protection']['deleteRows'] = function ($value) { |
|
167 | + $this->mappings['protection']['deleteRows'] = function($value) { |
|
169 | 168 | $this->object->getProtection()->setDeleteRows($value); |
170 | 169 | }; |
171 | - $this->mappings['protection']['formatCells'] = function ($value) { |
|
170 | + $this->mappings['protection']['formatCells'] = function($value) { |
|
172 | 171 | $this->object->getProtection()->setFormatCells($value); |
173 | 172 | }; |
174 | - $this->mappings['protection']['formatColumns'] = function ($value) { |
|
173 | + $this->mappings['protection']['formatColumns'] = function($value) { |
|
175 | 174 | $this->object->getProtection()->setFormatColumns($value); |
176 | 175 | }; |
177 | - $this->mappings['protection']['formatRows'] = function ($value) { |
|
176 | + $this->mappings['protection']['formatRows'] = function($value) { |
|
178 | 177 | $this->object->getProtection()->setFormatRows($value); |
179 | 178 | }; |
180 | - $this->mappings['protection']['insertColumns'] = function ($value) { |
|
179 | + $this->mappings['protection']['insertColumns'] = function($value) { |
|
181 | 180 | $this->object->getProtection()->setInsertColumns($value); |
182 | 181 | }; |
183 | - $this->mappings['protection']['insertHyperlinks'] = function ($value) { |
|
182 | + $this->mappings['protection']['insertHyperlinks'] = function($value) { |
|
184 | 183 | $this->object->getProtection()->setInsertHyperlinks($value); |
185 | 184 | }; |
186 | - $this->mappings['protection']['insertRows'] = function ($value) { |
|
185 | + $this->mappings['protection']['insertRows'] = function($value) { |
|
187 | 186 | $this->object->getProtection()->setInsertRows($value); |
188 | 187 | }; |
189 | - $this->mappings['protection']['objects'] = function ($value) { |
|
188 | + $this->mappings['protection']['objects'] = function($value) { |
|
190 | 189 | $this->object->getProtection()->setObjects($value); |
191 | 190 | }; |
192 | - $this->mappings['protection']['password'] = function ($value) { |
|
191 | + $this->mappings['protection']['password'] = function($value) { |
|
193 | 192 | $this->object->getProtection()->setPassword($value); |
194 | 193 | }; |
195 | - $this->mappings['protection']['pivotTables'] = function ($value) { |
|
194 | + $this->mappings['protection']['pivotTables'] = function($value) { |
|
196 | 195 | $this->object->getProtection()->setPivotTables($value); |
197 | 196 | }; |
198 | - $this->mappings['protection']['scenarios'] = function ($value) { |
|
197 | + $this->mappings['protection']['scenarios'] = function($value) { |
|
199 | 198 | $this->object->getProtection()->setScenarios($value); |
200 | 199 | }; |
201 | - $this->mappings['protection']['selectLockedCells'] = function ($value) { |
|
200 | + $this->mappings['protection']['selectLockedCells'] = function($value) { |
|
202 | 201 | $this->object->getProtection()->setSelectLockedCells($value); |
203 | 202 | }; |
204 | - $this->mappings['protection']['selectUnlockedCells'] = function ($value) { |
|
203 | + $this->mappings['protection']['selectUnlockedCells'] = function($value) { |
|
205 | 204 | $this->object->getProtection()->setSelectUnlockedCells($value); |
206 | 205 | }; |
207 | - $this->mappings['protection']['sheet'] = function ($value) { |
|
206 | + $this->mappings['protection']['sheet'] = function($value) { |
|
208 | 207 | $this->object->getProtection()->setSheet($value); |
209 | 208 | }; |
210 | - $this->mappings['protection']['sort'] = function ($value) { |
|
209 | + $this->mappings['protection']['sort'] = function($value) { |
|
211 | 210 | $this->object->getProtection()->setSort($value); |
212 | 211 | }; |
213 | - $this->mappings['rightToLeft'] = function ($value) { |
|
212 | + $this->mappings['rightToLeft'] = function($value) { |
|
214 | 213 | $this->object->setRightToLeft($value); |
215 | 214 | }; |
216 | - $this->mappings['rowDimension']['__multi'] = function ($column = 'default'): RowDimension { |
|
215 | + $this->mappings['rowDimension']['__multi'] = function($column = 'default'): RowDimension { |
|
217 | 216 | return $column === 'default' ? |
218 | - $this->object->getDefaultRowDimension() : |
|
219 | - $this->object->getRowDimension($column); |
|
217 | + $this->object->getDefaultRowDimension() : $this->object->getRowDimension($column); |
|
220 | 218 | }; |
221 | - $this->mappings['rowDimension']['collapsed'] = function ($value, RowDimension $object) { |
|
219 | + $this->mappings['rowDimension']['collapsed'] = function($value, RowDimension $object) { |
|
222 | 220 | $object->setCollapsed($value); |
223 | 221 | }; |
224 | - $this->mappings['rowDimension']['outlineLevel'] = function ($value, RowDimension $object) { |
|
222 | + $this->mappings['rowDimension']['outlineLevel'] = function($value, RowDimension $object) { |
|
225 | 223 | $object->setOutlineLevel($value); |
226 | 224 | }; |
227 | - $this->mappings['rowDimension']['rowHeight'] = function ($value, RowDimension $object) { |
|
225 | + $this->mappings['rowDimension']['rowHeight'] = function($value, RowDimension $object) { |
|
228 | 226 | $object->setRowHeight($value); |
229 | 227 | }; |
230 | - $this->mappings['rowDimension']['rowIndex'] = function ($value, RowDimension $object) { |
|
228 | + $this->mappings['rowDimension']['rowIndex'] = function($value, RowDimension $object) { |
|
231 | 229 | $object->setRowIndex($value); |
232 | 230 | }; |
233 | - $this->mappings['rowDimension']['visible'] = function ($value, RowDimension $object) { |
|
231 | + $this->mappings['rowDimension']['visible'] = function($value, RowDimension $object) { |
|
234 | 232 | $object->setVisible($value); |
235 | 233 | }; |
236 | - $this->mappings['rowDimension']['xfIndex'] = function ($value, RowDimension $object) { |
|
234 | + $this->mappings['rowDimension']['xfIndex'] = function($value, RowDimension $object) { |
|
237 | 235 | $object->setXfIndex($value); |
238 | 236 | }; |
239 | - $this->mappings['rowDimension']['zeroHeight'] = function ($value, RowDimension $object) { |
|
237 | + $this->mappings['rowDimension']['zeroHeight'] = function($value, RowDimension $object) { |
|
240 | 238 | $object->setZeroHeight($value); |
241 | 239 | }; |
242 | - $this->mappings['sheetState'] = function ($value) { |
|
240 | + $this->mappings['sheetState'] = function($value) { |
|
243 | 241 | $this->object->setSheetState($value); |
244 | 242 | }; |
245 | - $this->mappings['showGridlines'] = function ($value) { |
|
243 | + $this->mappings['showGridlines'] = function($value) { |
|
246 | 244 | $this->object->setShowGridlines($value); |
247 | 245 | }; |
248 | - $this->mappings['tabColor'] = function ($value) { |
|
246 | + $this->mappings['tabColor'] = function($value) { |
|
249 | 247 | $this->object->getTabColor()->setRGB($value); |
250 | 248 | }; |
251 | - $this->mappings['zoomScale'] = function ($value) { |
|
249 | + $this->mappings['zoomScale'] = function($value) { |
|
252 | 250 | $this->object->getSheetView()->setZoomScale($value); |
253 | 251 | }; |
254 | 252 | } |
@@ -261,7 +259,7 @@ discard block |
||
261 | 259 | */ |
262 | 260 | public function start($index, array $properties = []) |
263 | 261 | { |
264 | - if (is_int($index) && $index <$this->documentWrapper->getObject()->getSheetCount()) { |
|
262 | + if (is_int($index) && $index < $this->documentWrapper->getObject()->getSheetCount()) { |
|
265 | 263 | $this->object = $this->documentWrapper->getObject()->setActiveSheetIndex($index); |
266 | 264 | } elseif (is_string($index)) { |
267 | 265 | if (!$this->documentWrapper->getObject()->sheetNameExists($index)) { |
@@ -269,7 +267,7 @@ discard block |
||
269 | 267 | $this->documentWrapper->getObject()->createSheet()->setTitle($index); |
270 | 268 | } |
271 | 269 | $this->object = $this->documentWrapper->getObject()->setActiveSheetIndexByName($index); |
272 | - } else { |
|
270 | + } else { |
|
273 | 271 | // create new sheet without a name |
274 | 272 | $this->documentWrapper->getObject()->createSheet(); |
275 | 273 | $this->object = $this->documentWrapper->getObject()->setActiveSheetIndex(0); |
@@ -296,7 +294,7 @@ discard block |
||
296 | 294 | */ |
297 | 295 | $columnDimension = $this->attributes['properties']['columnDimension']; |
298 | 296 | foreach ($columnDimension as $key => $value) { |
299 | - if(isset($value['autoSize'])) { |
|
297 | + if (isset($value['autoSize'])) { |
|
300 | 298 | if ('default' === $key) { |
301 | 299 | try { |
302 | 300 | $cellIterator = $this->object->getRowIterator()->current()->getCellIterator(); |