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