@@ -58,61 +58,80 @@ |
||
| 58 | 58 | |
| 59 | 59 | protected function initializeMappings() |
| 60 | 60 | { |
| 61 | - $this->mappings['category'] = function ($value) { |
|
| 61 | + $this->mappings['category'] = function ($value) |
|
| 62 | + { |
|
| 62 | 63 | $this->object->getProperties()->setCategory($value); |
| 63 | 64 | }; |
| 64 | - $this->mappings['company'] = function ($value) { |
|
| 65 | + $this->mappings['company'] = function ($value) |
|
| 66 | + { |
|
| 65 | 67 | $this->object->getProperties()->setCompany($value); |
| 66 | 68 | }; |
| 67 | - $this->mappings['created'] = function ($value) { |
|
| 69 | + $this->mappings['created'] = function ($value) |
|
| 70 | + { |
|
| 68 | 71 | $this->object->getProperties()->setCreated($value); |
| 69 | 72 | }; |
| 70 | - $this->mappings['creator'] = function ($value) { |
|
| 73 | + $this->mappings['creator'] = function ($value) |
|
| 74 | + { |
|
| 71 | 75 | $this->object->getProperties()->setCreator($value); |
| 72 | 76 | }; |
| 73 | - $this->mappings['defaultStyle'] = function ($value) { |
|
| 77 | + $this->mappings['defaultStyle'] = function ($value) |
|
| 78 | + { |
|
| 74 | 79 | $this->object->getDefaultStyle()->applyFromArray($value); |
| 75 | 80 | }; |
| 76 | - $this->mappings['description'] = function ($value) { |
|
| 81 | + $this->mappings['description'] = function ($value) |
|
| 82 | + { |
|
| 77 | 83 | $this->object->getProperties()->setDescription($value); |
| 78 | 84 | }; |
| 79 | - $this->mappings['format'] = function ($value) { |
|
| 85 | + $this->mappings['format'] = function ($value) |
|
| 86 | + { |
|
| 80 | 87 | $this->attributes['format'] = $value; |
| 81 | 88 | }; |
| 82 | - $this->mappings['keywords'] = function ($value) { |
|
| 89 | + $this->mappings['keywords'] = function ($value) |
|
| 90 | + { |
|
| 83 | 91 | $this->object->getProperties()->setKeywords($value); |
| 84 | 92 | }; |
| 85 | - $this->mappings['lastModifiedBy'] = function ($value) { |
|
| 93 | + $this->mappings['lastModifiedBy'] = function ($value) |
|
| 94 | + { |
|
| 86 | 95 | $this->object->getProperties()->setLastModifiedBy($value); |
| 87 | 96 | }; |
| 88 | - $this->mappings['manager'] = function ($value) { |
|
| 97 | + $this->mappings['manager'] = function ($value) |
|
| 98 | + { |
|
| 89 | 99 | $this->object->getProperties()->setManager($value); |
| 90 | 100 | }; |
| 91 | - $this->mappings['modified'] = function ($value) { |
|
| 101 | + $this->mappings['modified'] = function ($value) |
|
| 102 | + { |
|
| 92 | 103 | $this->object->getProperties()->setModified($value); |
| 93 | 104 | }; |
| 94 | - $this->mappings['security']['lockRevision'] = function ($value) { |
|
| 105 | + $this->mappings['security']['lockRevision'] = function ($value) |
|
| 106 | + { |
|
| 95 | 107 | $this->object->getSecurity()->setLockRevision($value); |
| 96 | 108 | }; |
| 97 | - $this->mappings['security']['lockStructure'] = function ($value) { |
|
| 109 | + $this->mappings['security']['lockStructure'] = function ($value) |
|
| 110 | + { |
|
| 98 | 111 | $this->object->getSecurity()->setLockStructure($value); |
| 99 | 112 | }; |
| 100 | - $this->mappings['security']['lockWindows'] = function ($value) { |
|
| 113 | + $this->mappings['security']['lockWindows'] = function ($value) |
|
| 114 | + { |
|
| 101 | 115 | $this->object->getSecurity()->setLockWindows($value); |
| 102 | 116 | }; |
| 103 | - $this->mappings['security']['revisionsPassword'] = function ($value) { |
|
| 117 | + $this->mappings['security']['revisionsPassword'] = function ($value) |
|
| 118 | + { |
|
| 104 | 119 | $this->object->getSecurity()->setRevisionsPassword($value); |
| 105 | 120 | }; |
| 106 | - $this->mappings['security']['workbookPassword'] = function ($value) { |
|
| 121 | + $this->mappings['security']['workbookPassword'] = function ($value) |
|
| 122 | + { |
|
| 107 | 123 | $this->object->getSecurity()->setWorkbookPassword($value); |
| 108 | 124 | }; |
| 109 | - $this->mappings['subject'] = function ($value) { |
|
| 125 | + $this->mappings['subject'] = function ($value) |
|
| 126 | + { |
|
| 110 | 127 | $this->object->getProperties()->setSubject($value); |
| 111 | 128 | }; |
| 112 | - $this->mappings['template'] = function ($value) { |
|
| 129 | + $this->mappings['template'] = function ($value) |
|
| 130 | + { |
|
| 113 | 131 | $this->attributes['template'] = $value; |
| 114 | 132 | }; |
| 115 | - $this->mappings['title'] = function ($value) { |
|
| 133 | + $this->mappings['title'] = function ($value) |
|
| 134 | + { |
|
| 116 | 135 | $this->object->getProperties()->setTitle($value); |
| 117 | 136 | }; |
| 118 | 137 | } |
@@ -79,167 +79,221 @@ discard block |
||
| 79 | 79 | protected function initializeMappings() |
| 80 | 80 | { |
| 81 | 81 | $this->mappings['columnDimension']['__multi'] = true; |
| 82 | - $this->mappings['columnDimension']['__object'] = function ($key = 'default') { |
|
| 82 | + $this->mappings['columnDimension']['__object'] = function ($key = 'default') |
|
| 83 | + { |
|
| 83 | 84 | return $key === 'default' ? $this->object->getDefaultColumnDimension() : $this->object->getColumnDimension($key); |
| 84 | 85 | }; |
| 85 | - $this->mappings['columnDimension']['autoSize'] = function ($key, $value) { |
|
| 86 | + $this->mappings['columnDimension']['autoSize'] = function ($key, $value) |
|
| 87 | + { |
|
| 86 | 88 | $this->mappings['columnDimension']['__object']($key)->setAutoSize($value); |
| 87 | 89 | }; |
| 88 | - $this->mappings['columnDimension']['collapsed'] = function ($key, $value) { |
|
| 90 | + $this->mappings['columnDimension']['collapsed'] = function ($key, $value) |
|
| 91 | + { |
|
| 89 | 92 | $this->mappings['columnDimension']['__object']($key)->setCollapsed($value); |
| 90 | 93 | }; |
| 91 | - $this->mappings['columnDimension']['columnIndex'] = function ($key, $value) { |
|
| 94 | + $this->mappings['columnDimension']['columnIndex'] = function ($key, $value) |
|
| 95 | + { |
|
| 92 | 96 | $this->mappings['columnDimension']['__object']($key)->setColumnIndex($value); |
| 93 | 97 | }; |
| 94 | - $this->mappings['columnDimension']['outlineLevel'] = function ($key, $value) { |
|
| 98 | + $this->mappings['columnDimension']['outlineLevel'] = function ($key, $value) |
|
| 99 | + { |
|
| 95 | 100 | $this->mappings['columnDimension']['__object']($key)->setOutlineLevel($value); |
| 96 | 101 | }; |
| 97 | - $this->mappings['columnDimension']['visible'] = function ($key, $value) { |
|
| 102 | + $this->mappings['columnDimension']['visible'] = function ($key, $value) |
|
| 103 | + { |
|
| 98 | 104 | $this->mappings['columnDimension']['__object']($key)->setVisible($value); |
| 99 | 105 | }; |
| 100 | - $this->mappings['columnDimension']['width'] = function ($key, $value) { |
|
| 106 | + $this->mappings['columnDimension']['width'] = function ($key, $value) |
|
| 107 | + { |
|
| 101 | 108 | $this->mappings['columnDimension']['__object']($key)->setWidth($value); |
| 102 | 109 | }; |
| 103 | - $this->mappings['columnDimension']['xfIndex'] = function ($key, $value) { |
|
| 110 | + $this->mappings['columnDimension']['xfIndex'] = function ($key, $value) |
|
| 111 | + { |
|
| 104 | 112 | $this->mappings['columnDimension']['__object']($key)->setXfIndex($value); |
| 105 | 113 | }; |
| 106 | - $this->mappings['pageMargins']['top'] = function ($value) { |
|
| 114 | + $this->mappings['pageMargins']['top'] = function ($value) |
|
| 115 | + { |
|
| 107 | 116 | $this->object->getPageMargins()->setTop($value); |
| 108 | 117 | }; |
| 109 | - $this->mappings['pageMargins']['bottom'] = function ($value) { |
|
| 118 | + $this->mappings['pageMargins']['bottom'] = function ($value) |
|
| 119 | + { |
|
| 110 | 120 | $this->object->getPageMargins()->setBottom($value); |
| 111 | 121 | }; |
| 112 | - $this->mappings['pageMargins']['left'] = function ($value) { |
|
| 122 | + $this->mappings['pageMargins']['left'] = function ($value) |
|
| 123 | + { |
|
| 113 | 124 | $this->object->getPageMargins()->setLeft($value); |
| 114 | 125 | }; |
| 115 | - $this->mappings['pageMargins']['right'] = function ($value) { |
|
| 126 | + $this->mappings['pageMargins']['right'] = function ($value) |
|
| 127 | + { |
|
| 116 | 128 | $this->object->getPageMargins()->setRight($value); |
| 117 | 129 | }; |
| 118 | - $this->mappings['pageMargins']['header'] = function ($value) { |
|
| 130 | + $this->mappings['pageMargins']['header'] = function ($value) |
|
| 131 | + { |
|
| 119 | 132 | $this->object->getPageMargins()->setHeader($value); |
| 120 | 133 | }; |
| 121 | - $this->mappings['pageMargins']['footer'] = function ($value) { |
|
| 134 | + $this->mappings['pageMargins']['footer'] = function ($value) |
|
| 135 | + { |
|
| 122 | 136 | $this->object->getPageMargins()->setFooter($value); |
| 123 | 137 | }; |
| 124 | - $this->mappings['pageSetup']['fitToHeight'] = function ($value) { |
|
| 138 | + $this->mappings['pageSetup']['fitToHeight'] = function ($value) |
|
| 139 | + { |
|
| 125 | 140 | $this->object->getPageSetup()->setFitToHeight($value); |
| 126 | 141 | }; |
| 127 | - $this->mappings['pageSetup']['fitToPage'] = function ($value) { |
|
| 142 | + $this->mappings['pageSetup']['fitToPage'] = function ($value) |
|
| 143 | + { |
|
| 128 | 144 | $this->object->getPageSetup()->setFitToPage($value); |
| 129 | 145 | }; |
| 130 | - $this->mappings['pageSetup']['fitToWidth'] = function ($value) { |
|
| 146 | + $this->mappings['pageSetup']['fitToWidth'] = function ($value) |
|
| 147 | + { |
|
| 131 | 148 | $this->object->getPageSetup()->setFitToWidth($value); |
| 132 | 149 | }; |
| 133 | - $this->mappings['pageSetup']['horizontalCentered'] = function ($value) { |
|
| 150 | + $this->mappings['pageSetup']['horizontalCentered'] = function ($value) |
|
| 151 | + { |
|
| 134 | 152 | $this->object->getPageSetup()->setHorizontalCentered($value); |
| 135 | 153 | }; |
| 136 | - $this->mappings['pageSetup']['orientation'] = function ($value) { |
|
| 154 | + $this->mappings['pageSetup']['orientation'] = function ($value) |
|
| 155 | + { |
|
| 137 | 156 | $this->object->getPageSetup()->setOrientation($value); |
| 138 | 157 | }; |
| 139 | - $this->mappings['pageSetup']['paperSize'] = function ($value) { |
|
| 158 | + $this->mappings['pageSetup']['paperSize'] = function ($value) |
|
| 159 | + { |
|
| 140 | 160 | $this->object->getPageSetup()->setPaperSize($value); |
| 141 | 161 | }; |
| 142 | - $this->mappings['pageSetup']['printArea'] = function ($value) { |
|
| 162 | + $this->mappings['pageSetup']['printArea'] = function ($value) |
|
| 163 | + { |
|
| 143 | 164 | $this->object->getPageSetup()->setPrintArea($value); |
| 144 | 165 | }; |
| 145 | - $this->mappings['pageSetup']['scale'] = function ($value) { |
|
| 166 | + $this->mappings['pageSetup']['scale'] = function ($value) |
|
| 167 | + { |
|
| 146 | 168 | $this->object->getPageSetup()->setScale($value); |
| 147 | 169 | }; |
| 148 | - $this->mappings['pageSetup']['verticalCentered'] = function ($value) { |
|
| 170 | + $this->mappings['pageSetup']['verticalCentered'] = function ($value) |
|
| 171 | + { |
|
| 149 | 172 | $this->object->getPageSetup()->setVerticalCentered($value); |
| 150 | 173 | }; |
| 151 | - $this->mappings['printGridlines'] = function ($value) { |
|
| 174 | + $this->mappings['printGridlines'] = function ($value) |
|
| 175 | + { |
|
| 152 | 176 | $this->object->setPrintGridlines($value); |
| 153 | 177 | }; |
| 154 | - $this->mappings['protection']['autoFilter'] = function ($value) { |
|
| 178 | + $this->mappings['protection']['autoFilter'] = function ($value) |
|
| 179 | + { |
|
| 155 | 180 | $this->object->getProtection()->setAutoFilter($value); |
| 156 | 181 | }; |
| 157 | - $this->mappings['protection']['deleteColumns'] = function ($value) { |
|
| 182 | + $this->mappings['protection']['deleteColumns'] = function ($value) |
|
| 183 | + { |
|
| 158 | 184 | $this->object->getProtection()->setDeleteColumns($value); |
| 159 | 185 | }; |
| 160 | - $this->mappings['protection']['deleteRows'] = function ($value) { |
|
| 186 | + $this->mappings['protection']['deleteRows'] = function ($value) |
|
| 187 | + { |
|
| 161 | 188 | $this->object->getProtection()->setDeleteRows($value); |
| 162 | 189 | }; |
| 163 | - $this->mappings['protection']['formatCells'] = function ($value) { |
|
| 190 | + $this->mappings['protection']['formatCells'] = function ($value) |
|
| 191 | + { |
|
| 164 | 192 | $this->object->getProtection()->setFormatCells($value); |
| 165 | 193 | }; |
| 166 | - $this->mappings['protection']['formatColumns'] = function ($value) { |
|
| 194 | + $this->mappings['protection']['formatColumns'] = function ($value) |
|
| 195 | + { |
|
| 167 | 196 | $this->object->getProtection()->setFormatColumns($value); |
| 168 | 197 | }; |
| 169 | - $this->mappings['protection']['formatRows'] = function ($value) { |
|
| 198 | + $this->mappings['protection']['formatRows'] = function ($value) |
|
| 199 | + { |
|
| 170 | 200 | $this->object->getProtection()->setFormatRows($value); |
| 171 | 201 | }; |
| 172 | - $this->mappings['protection']['insertColumns'] = function ($value) { |
|
| 202 | + $this->mappings['protection']['insertColumns'] = function ($value) |
|
| 203 | + { |
|
| 173 | 204 | $this->object->getProtection()->setInsertColumns($value); |
| 174 | 205 | }; |
| 175 | - $this->mappings['protection']['insertHyperlinks'] = function ($value) { |
|
| 206 | + $this->mappings['protection']['insertHyperlinks'] = function ($value) |
|
| 207 | + { |
|
| 176 | 208 | $this->object->getProtection()->setInsertHyperlinks($value); |
| 177 | 209 | }; |
| 178 | - $this->mappings['protection']['insertRows'] = function ($value) { |
|
| 210 | + $this->mappings['protection']['insertRows'] = function ($value) |
|
| 211 | + { |
|
| 179 | 212 | $this->object->getProtection()->setInsertRows($value); |
| 180 | 213 | }; |
| 181 | - $this->mappings['protection']['objects'] = function ($value) { |
|
| 214 | + $this->mappings['protection']['objects'] = function ($value) |
|
| 215 | + { |
|
| 182 | 216 | $this->object->getProtection()->setObjects($value); |
| 183 | 217 | }; |
| 184 | - $this->mappings['protection']['password'] = function ($value) { |
|
| 218 | + $this->mappings['protection']['password'] = function ($value) |
|
| 219 | + { |
|
| 185 | 220 | $this->object->getProtection()->setPassword($value); |
| 186 | 221 | }; |
| 187 | - $this->mappings['protection']['pivotTables'] = function ($value) { |
|
| 222 | + $this->mappings['protection']['pivotTables'] = function ($value) |
|
| 223 | + { |
|
| 188 | 224 | $this->object->getProtection()->setPivotTables($value); |
| 189 | 225 | }; |
| 190 | - $this->mappings['protection']['scenarios'] = function ($value) { |
|
| 226 | + $this->mappings['protection']['scenarios'] = function ($value) |
|
| 227 | + { |
|
| 191 | 228 | $this->object->getProtection()->setScenarios($value); |
| 192 | 229 | }; |
| 193 | - $this->mappings['protection']['selectLockedCells'] = function ($value) { |
|
| 230 | + $this->mappings['protection']['selectLockedCells'] = function ($value) |
|
| 231 | + { |
|
| 194 | 232 | $this->object->getProtection()->setSelectLockedCells($value); |
| 195 | 233 | }; |
| 196 | - $this->mappings['protection']['selectUnlockedCells'] = function ($value) { |
|
| 234 | + $this->mappings['protection']['selectUnlockedCells'] = function ($value) |
|
| 235 | + { |
|
| 197 | 236 | $this->object->getProtection()->setSelectUnlockedCells($value); |
| 198 | 237 | }; |
| 199 | - $this->mappings['protection']['sheet'] = function ($value) { |
|
| 238 | + $this->mappings['protection']['sheet'] = function ($value) |
|
| 239 | + { |
|
| 200 | 240 | $this->object->getProtection()->setSheet($value); |
| 201 | 241 | }; |
| 202 | - $this->mappings['protection']['sort'] = function ($value) { |
|
| 242 | + $this->mappings['protection']['sort'] = function ($value) |
|
| 243 | + { |
|
| 203 | 244 | $this->object->getProtection()->setSort($value); |
| 204 | 245 | }; |
| 205 | - $this->mappings['rightToLeft'] = function ($value) { |
|
| 246 | + $this->mappings['rightToLeft'] = function ($value) |
|
| 247 | + { |
|
| 206 | 248 | $this->object->setRightToLeft($value); |
| 207 | 249 | }; |
| 208 | 250 | $this->mappings['rowDimension']['__multi'] = true; |
| 209 | - $this->mappings['rowDimension']['__object'] = function ($key) { |
|
| 251 | + $this->mappings['rowDimension']['__object'] = function ($key) |
|
| 252 | + { |
|
| 210 | 253 | return $key === 'default' ? $this->object->getDefaultRowDimension() : $this->object->getRowDimension($key); |
| 211 | 254 | }; |
| 212 | - $this->mappings['rowDimension']['collapsed'] = function ($key, $value) { |
|
| 255 | + $this->mappings['rowDimension']['collapsed'] = function ($key, $value) |
|
| 256 | + { |
|
| 213 | 257 | $this->mappings['rowDimension']['__object']($key)->setCollapsed($value); |
| 214 | 258 | }; |
| 215 | - $this->mappings['rowDimension']['outlineLevel'] = function ($key, $value) { |
|
| 259 | + $this->mappings['rowDimension']['outlineLevel'] = function ($key, $value) |
|
| 260 | + { |
|
| 216 | 261 | $this->mappings['rowDimension']['__object']($key)->setOutlineLevel($value); |
| 217 | 262 | }; |
| 218 | - $this->mappings['rowDimension']['rowHeight'] = function ($key, $value) { |
|
| 263 | + $this->mappings['rowDimension']['rowHeight'] = function ($key, $value) |
|
| 264 | + { |
|
| 219 | 265 | $this->mappings['rowDimension']['__object']($key)->setRowHeight($value); |
| 220 | 266 | }; |
| 221 | - $this->mappings['rowDimension']['rowIndex'] = function ($key, $value) { |
|
| 267 | + $this->mappings['rowDimension']['rowIndex'] = function ($key, $value) |
|
| 268 | + { |
|
| 222 | 269 | $this->mappings['rowDimension']['__object']($key)->setRowIndex($value); |
| 223 | 270 | }; |
| 224 | - $this->mappings['rowDimension']['visible'] = function ($key, $value) { |
|
| 271 | + $this->mappings['rowDimension']['visible'] = function ($key, $value) |
|
| 272 | + { |
|
| 225 | 273 | $this->mappings['rowDimension']['__object']($key)->setVisible($value); |
| 226 | 274 | }; |
| 227 | - $this->mappings['rowDimension']['xfIndex'] = function ($key, $value) { |
|
| 275 | + $this->mappings['rowDimension']['xfIndex'] = function ($key, $value) |
|
| 276 | + { |
|
| 228 | 277 | $this->mappings['rowDimension']['__object']($key)->setXfIndex($value); |
| 229 | 278 | }; |
| 230 | - $this->mappings['rowDimension']['zeroHeight'] = function ($key, $value) { |
|
| 279 | + $this->mappings['rowDimension']['zeroHeight'] = function ($key, $value) |
|
| 280 | + { |
|
| 231 | 281 | $this->mappings['rowDimension']['__object']($key)->setZeroHeight($value); |
| 232 | 282 | }; |
| 233 | - $this->mappings['sheetState'] = function ($value) { |
|
| 283 | + $this->mappings['sheetState'] = function ($value) |
|
| 284 | + { |
|
| 234 | 285 | $this->object->setSheetState($value); |
| 235 | 286 | }; |
| 236 | - $this->mappings['showGridlines'] = function ($value) { |
|
| 287 | + $this->mappings['showGridlines'] = function ($value) |
|
| 288 | + { |
|
| 237 | 289 | $this->object->setShowGridlines($value); |
| 238 | 290 | }; |
| 239 | - $this->mappings['tabColor'] = function ($value) { |
|
| 291 | + $this->mappings['tabColor'] = function ($value) |
|
| 292 | + { |
|
| 240 | 293 | $this->object->getTabColor()->setRGB($value); |
| 241 | 294 | }; |
| 242 | - $this->mappings['zoomScale'] = function ($value) { |
|
| 295 | + $this->mappings['zoomScale'] = function ($value) |
|
| 296 | + { |
|
| 243 | 297 | $this->object->getSheetView()->setZoomScale($value); |
| 244 | 298 | }; |
| 245 | 299 | } |
@@ -259,7 +313,7 @@ discard block |
||
| 259 | 313 | $this->documentWrapper->getObject()->createSheet()->setTitle($index); |
| 260 | 314 | } |
| 261 | 315 | $this->object = $this->documentWrapper->getObject()->setActiveSheetIndexByName($index); |
| 262 | - } else { |
|
| 316 | + } else { |
|
| 263 | 317 | // create new sheet without a name |
| 264 | 318 | $this->documentWrapper->getObject()->createSheet(); |
| 265 | 319 | $this->object = $this->documentWrapper->getObject()->setActiveSheetIndex(0); |