@@ -28,12 +28,12 @@ |
||
| 28 | 28 | public function compile(Twig_Compiler $compiler) |
| 29 | 29 | { |
| 30 | 30 | $compiler->addDebugInfo($this) |
| 31 | - ->write('$context[\'phpExcel\']->startAlignment(\'right\');' . PHP_EOL) |
|
| 31 | + ->write('$context[\'phpExcel\']->startAlignment(\'right\');'.PHP_EOL) |
|
| 32 | 32 | ->write("ob_start();\n") |
| 33 | 33 | ->subcompile($this->getNode('body')) |
| 34 | - ->write('$rightValue = trim(ob_get_clean());' . PHP_EOL) |
|
| 35 | - ->write('$context[\'phpExcel\']->endAlignment($rightValue);' . PHP_EOL) |
|
| 36 | - ->write('unset($rightValue);' . PHP_EOL); |
|
| 34 | + ->write('$rightValue = trim(ob_get_clean());'.PHP_EOL) |
|
| 35 | + ->write('$context[\'phpExcel\']->endAlignment($rightValue);'.PHP_EOL) |
|
| 36 | + ->write('unset($rightValue);'.PHP_EOL); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -32,12 +32,12 @@ |
||
| 32 | 32 | $compiler->addDebugInfo($this) |
| 33 | 33 | ->write('$context[\'phpExcel\']->setRowIndex(') |
| 34 | 34 | ->subcompile($this->getNode('index')) |
| 35 | - ->raw(');' . PHP_EOL) |
|
| 36 | - ->write('$context[\'phpExcel\']->startRow($context[\'phpExcel\']->getRowIndex());' . PHP_EOL) |
|
| 37 | - ->write('$context[\'phpExcel\']->setRowIndex(0);' . PHP_EOL) |
|
| 35 | + ->raw(');'.PHP_EOL) |
|
| 36 | + ->write('$context[\'phpExcel\']->startRow($context[\'phpExcel\']->getRowIndex());'.PHP_EOL) |
|
| 37 | + ->write('$context[\'phpExcel\']->setRowIndex(0);'.PHP_EOL) |
|
| 38 | 38 | ->subcompile($this->getNode('body')) |
| 39 | 39 | ->addDebugInfo($this) |
| 40 | - ->write('$context[\'phpExcel\']->endRow();' . PHP_EOL); |
|
| 40 | + ->write('$context[\'phpExcel\']->endRow();'.PHP_EOL); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | /** |
@@ -33,18 +33,18 @@ |
||
| 33 | 33 | $compiler->addDebugInfo($this) |
| 34 | 34 | ->write('$sheetIndex = ') |
| 35 | 35 | ->subcompile($this->getNode('index')) |
| 36 | - ->raw(';' . PHP_EOL) |
|
| 36 | + ->raw(';'.PHP_EOL) |
|
| 37 | 37 | ->write('$sheetProperties = ') |
| 38 | 38 | ->subcompile($this->getNode('properties')) |
| 39 | - ->raw(';' . PHP_EOL) |
|
| 40 | - ->write('$context[\'phpExcel\']->startSheet($sheetIndex, $sheetProperties);' . PHP_EOL) |
|
| 41 | - ->write('unset($sheetIndex, $sheetProperties);' . PHP_EOL); |
|
| 39 | + ->raw(';'.PHP_EOL) |
|
| 40 | + ->write('$context[\'phpExcel\']->startSheet($sheetIndex, $sheetProperties);'.PHP_EOL) |
|
| 41 | + ->write('unset($sheetIndex, $sheetProperties);'.PHP_EOL); |
|
| 42 | 42 | |
| 43 | 43 | if ($this->hasNode('body')) { |
| 44 | 44 | $compiler->subcompile($this->getNode('body')); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - $compiler->addDebugInfo($this)->write('$context[\'phpExcel\']->endSheet();' . PHP_EOL); |
|
| 47 | + $compiler->addDebugInfo($this)->write('$context[\'phpExcel\']->endSheet();'.PHP_EOL); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
@@ -32,12 +32,10 @@ |
||
| 32 | 32 | if (($node instanceof Twig_Node_Block || $node instanceof Twig_Node_Macro) && !$node->hasAttribute('twigExcelBundle') && $this->checkContainsXlsNode($node)) { |
| 33 | 33 | if ($node instanceof Twig_Node_Block) { |
| 34 | 34 | throw new Twig_Error_Syntax('Block tags do not work together with Twig tags provided by TwigExcelBundle. Please use \'xlsblock\' instead.'); |
| 35 | - } |
|
| 36 | - elseif ($node instanceof Twig_Node_Macro) { |
|
| 35 | + } elseif ($node instanceof Twig_Node_Macro) { |
|
| 37 | 36 | throw new Twig_Error_Syntax('Macro tags do not work together with Twig tags provided by TwigExcelBundle. Please use \'xlsmacro\' instead.'); |
| 38 | 37 | } |
| 39 | - } |
|
| 40 | - elseif ($node instanceof XlsNode) { |
|
| 38 | + } elseif ($node instanceof XlsNode) { |
|
| 41 | 39 | /** |
| 42 | 40 | * @var XlsNode $node |
| 43 | 41 | */ |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | */ |
| 45 | 45 | try { |
| 46 | 46 | NodeHelper::checkAllowedParents($node, $this->path); |
| 47 | - } catch(Twig_Error_Syntax $e) { |
|
| 47 | + } catch (Twig_Error_Syntax $e) { |
|
| 48 | 48 | // reset path since throwing an error prevents doLeaveNode to be called |
| 49 | 49 | $this->path = []; |
| 50 | 50 | throw $e; |
@@ -20,8 +20,8 @@ |
||
| 20 | 20 | */ |
| 21 | 21 | protected function parseBody() |
| 22 | 22 | { |
| 23 | - $body = $this->parser->subparse(function (Twig_Token $token) { |
|
| 24 | - return $token->test('end' . $this->getTag()); |
|
| 23 | + $body = $this->parser->subparse(function(Twig_Token $token) { |
|
| 24 | + return $token->test('end'.$this->getTag()); |
|
| 25 | 25 | }, |
| 26 | 26 | true); |
| 27 | 27 | $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); |
@@ -20,7 +20,8 @@ |
||
| 20 | 20 | */ |
| 21 | 21 | protected function parseBody() |
| 22 | 22 | { |
| 23 | - $body = $this->parser->subparse(function (Twig_Token $token) { |
|
| 23 | + $body = $this->parser->subparse(function (Twig_Token $token) |
|
| 24 | + { |
|
| 24 | 25 | return $token->test('end' . $this->getTag()); |
| 25 | 26 | }, |
| 26 | 27 | true); |
@@ -55,52 +55,52 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | protected function initializeMappings() |
| 57 | 57 | { |
| 58 | - $this->mappings['coordinates'] = function ($value) { |
|
| 58 | + $this->mappings['coordinates'] = function($value) { |
|
| 59 | 59 | $this->object->setCoordinates($value); |
| 60 | 60 | }; |
| 61 | - $this->mappings['description'] = function ($value) { |
|
| 61 | + $this->mappings['description'] = function($value) { |
|
| 62 | 62 | $this->object->setDescription($value); |
| 63 | 63 | }; |
| 64 | - $this->mappings['height'] = function ($value) { |
|
| 64 | + $this->mappings['height'] = function($value) { |
|
| 65 | 65 | $this->object->setHeight($value); |
| 66 | 66 | }; |
| 67 | - $this->mappings['name'] = function ($value) { |
|
| 67 | + $this->mappings['name'] = function($value) { |
|
| 68 | 68 | $this->object->setName($value); |
| 69 | 69 | }; |
| 70 | - $this->mappings['offsetX'] = function ($value) { |
|
| 70 | + $this->mappings['offsetX'] = function($value) { |
|
| 71 | 71 | $this->object->setOffsetX($value); |
| 72 | 72 | }; |
| 73 | - $this->mappings['offsetY'] = function ($value) { |
|
| 73 | + $this->mappings['offsetY'] = function($value) { |
|
| 74 | 74 | $this->object->setOffsetY($value); |
| 75 | 75 | }; |
| 76 | - $this->mappings['resizeProportional'] = function ($value) { |
|
| 76 | + $this->mappings['resizeProportional'] = function($value) { |
|
| 77 | 77 | $this->object->setResizeProportional($value); |
| 78 | 78 | }; |
| 79 | - $this->mappings['rotation'] = function ($value) { |
|
| 79 | + $this->mappings['rotation'] = function($value) { |
|
| 80 | 80 | $this->object->setRotation($value); |
| 81 | 81 | }; |
| 82 | - $this->mappings['shadow']['alignment'] = function ($value) { |
|
| 82 | + $this->mappings['shadow']['alignment'] = function($value) { |
|
| 83 | 83 | $this->object->getShadow()->setAlignment($value); |
| 84 | 84 | }; |
| 85 | - $this->mappings['shadow']['alpha'] = function ($value) { |
|
| 85 | + $this->mappings['shadow']['alpha'] = function($value) { |
|
| 86 | 86 | $this->object->getShadow()->setAlpha($value); |
| 87 | 87 | }; |
| 88 | - $this->mappings['shadow']['blurRadius'] = function ($value) { |
|
| 88 | + $this->mappings['shadow']['blurRadius'] = function($value) { |
|
| 89 | 89 | $this->object->getShadow()->setBlurRadius($value); |
| 90 | 90 | }; |
| 91 | - $this->mappings['shadow']['color'] = function ($value) { |
|
| 91 | + $this->mappings['shadow']['color'] = function($value) { |
|
| 92 | 92 | $this->object->getShadow()->getColor()->setRGB($value); |
| 93 | 93 | }; |
| 94 | - $this->mappings['shadow']['direction'] = function ($value) { |
|
| 94 | + $this->mappings['shadow']['direction'] = function($value) { |
|
| 95 | 95 | $this->object->getShadow()->setDirection($value); |
| 96 | 96 | }; |
| 97 | - $this->mappings['shadow']['distance'] = function ($value) { |
|
| 97 | + $this->mappings['shadow']['distance'] = function($value) { |
|
| 98 | 98 | $this->object->getShadow()->setDistance($value); |
| 99 | 99 | }; |
| 100 | - $this->mappings['shadow']['visible'] = function ($value) { |
|
| 100 | + $this->mappings['shadow']['visible'] = function($value) { |
|
| 101 | 101 | $this->object->getShadow()->setVisible($value); |
| 102 | 102 | }; |
| 103 | - $this->mappings['width'] = function ($value) { |
|
| 103 | + $this->mappings['width'] = function($value) { |
|
| 104 | 104 | $this->object->setWidth($value); |
| 105 | 105 | }; |
| 106 | 106 | } |
@@ -194,21 +194,21 @@ discard block |
||
| 194 | 194 | { |
| 195 | 195 | // create temp path |
| 196 | 196 | $pathExtension = pathinfo($path, PATHINFO_EXTENSION); |
| 197 | - $tempPath = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'xlsdrawing' . '_' . md5($path) . ($pathExtension ? '.' . $pathExtension : ''); |
|
| 197 | + $tempPath = sys_get_temp_dir().DIRECTORY_SEPARATOR.'xlsdrawing'.'_'.md5($path).($pathExtension ? '.'.$pathExtension : ''); |
|
| 198 | 198 | |
| 199 | 199 | // create local copy |
| 200 | 200 | if (!file_exists($tempPath)) { |
| 201 | 201 | $data = file_get_contents($path); |
| 202 | 202 | if ($data === false) { |
| 203 | - throw new \InvalidArgumentException($path . ' does not exist.'); |
|
| 203 | + throw new \InvalidArgumentException($path.' does not exist.'); |
|
| 204 | 204 | } |
| 205 | 205 | $temp = fopen($tempPath, 'w+'); |
| 206 | 206 | if ($temp === false) { |
| 207 | - throw new \RuntimeException('Cannot open ' . $tempPath); |
|
| 207 | + throw new \RuntimeException('Cannot open '.$tempPath); |
|
| 208 | 208 | } |
| 209 | 209 | fwrite($temp, $data); |
| 210 | 210 | if (fclose($temp) === false) { |
| 211 | - throw new \RuntimeException('Cannot close ' . $tempPath); |
|
| 211 | + throw new \RuntimeException('Cannot close '.$tempPath); |
|
| 212 | 212 | } |
| 213 | 213 | unset($data, $temp); |
| 214 | 214 | } |
@@ -55,52 +55,68 @@ |
||
| 55 | 55 | |
| 56 | 56 | protected function initializeMappings() |
| 57 | 57 | { |
| 58 | - $this->mappings['coordinates'] = function ($value) { |
|
| 58 | + $this->mappings['coordinates'] = function ($value) |
|
| 59 | + { |
|
| 59 | 60 | $this->object->setCoordinates($value); |
| 60 | 61 | }; |
| 61 | - $this->mappings['description'] = function ($value) { |
|
| 62 | + $this->mappings['description'] = function ($value) |
|
| 63 | + { |
|
| 62 | 64 | $this->object->setDescription($value); |
| 63 | 65 | }; |
| 64 | - $this->mappings['height'] = function ($value) { |
|
| 66 | + $this->mappings['height'] = function ($value) |
|
| 67 | + { |
|
| 65 | 68 | $this->object->setHeight($value); |
| 66 | 69 | }; |
| 67 | - $this->mappings['name'] = function ($value) { |
|
| 70 | + $this->mappings['name'] = function ($value) |
|
| 71 | + { |
|
| 68 | 72 | $this->object->setName($value); |
| 69 | 73 | }; |
| 70 | - $this->mappings['offsetX'] = function ($value) { |
|
| 74 | + $this->mappings['offsetX'] = function ($value) |
|
| 75 | + { |
|
| 71 | 76 | $this->object->setOffsetX($value); |
| 72 | 77 | }; |
| 73 | - $this->mappings['offsetY'] = function ($value) { |
|
| 78 | + $this->mappings['offsetY'] = function ($value) |
|
| 79 | + { |
|
| 74 | 80 | $this->object->setOffsetY($value); |
| 75 | 81 | }; |
| 76 | - $this->mappings['resizeProportional'] = function ($value) { |
|
| 82 | + $this->mappings['resizeProportional'] = function ($value) |
|
| 83 | + { |
|
| 77 | 84 | $this->object->setResizeProportional($value); |
| 78 | 85 | }; |
| 79 | - $this->mappings['rotation'] = function ($value) { |
|
| 86 | + $this->mappings['rotation'] = function ($value) |
|
| 87 | + { |
|
| 80 | 88 | $this->object->setRotation($value); |
| 81 | 89 | }; |
| 82 | - $this->mappings['shadow']['alignment'] = function ($value) { |
|
| 90 | + $this->mappings['shadow']['alignment'] = function ($value) |
|
| 91 | + { |
|
| 83 | 92 | $this->object->getShadow()->setAlignment($value); |
| 84 | 93 | }; |
| 85 | - $this->mappings['shadow']['alpha'] = function ($value) { |
|
| 94 | + $this->mappings['shadow']['alpha'] = function ($value) |
|
| 95 | + { |
|
| 86 | 96 | $this->object->getShadow()->setAlpha($value); |
| 87 | 97 | }; |
| 88 | - $this->mappings['shadow']['blurRadius'] = function ($value) { |
|
| 98 | + $this->mappings['shadow']['blurRadius'] = function ($value) |
|
| 99 | + { |
|
| 89 | 100 | $this->object->getShadow()->setBlurRadius($value); |
| 90 | 101 | }; |
| 91 | - $this->mappings['shadow']['color'] = function ($value) { |
|
| 102 | + $this->mappings['shadow']['color'] = function ($value) |
|
| 103 | + { |
|
| 92 | 104 | $this->object->getShadow()->getColor()->setRGB($value); |
| 93 | 105 | }; |
| 94 | - $this->mappings['shadow']['direction'] = function ($value) { |
|
| 106 | + $this->mappings['shadow']['direction'] = function ($value) |
|
| 107 | + { |
|
| 95 | 108 | $this->object->getShadow()->setDirection($value); |
| 96 | 109 | }; |
| 97 | - $this->mappings['shadow']['distance'] = function ($value) { |
|
| 110 | + $this->mappings['shadow']['distance'] = function ($value) |
|
| 111 | + { |
|
| 98 | 112 | $this->object->getShadow()->setDistance($value); |
| 99 | 113 | }; |
| 100 | - $this->mappings['shadow']['visible'] = function ($value) { |
|
| 114 | + $this->mappings['shadow']['visible'] = function ($value) |
|
| 115 | + { |
|
| 101 | 116 | $this->object->getShadow()->setVisible($value); |
| 102 | 117 | }; |
| 103 | - $this->mappings['width'] = function ($value) { |
|
| 118 | + $this->mappings['width'] = function ($value) |
|
| 119 | + { |
|
| 104 | 120 | $this->object->setWidth($value); |
| 105 | 121 | }; |
| 106 | 122 | } |
@@ -56,10 +56,10 @@ |
||
| 56 | 56 | |
| 57 | 57 | protected function initializeMappings() |
| 58 | 58 | { |
| 59 | - $this->mappings['scaleWithDocument'] = function ($value) { |
|
| 59 | + $this->mappings['scaleWithDocument'] = function($value) { |
|
| 60 | 60 | $this->object->setScaleWithDocument($value); |
| 61 | 61 | }; |
| 62 | - $this->mappings['alignWithMargins'] = function ($value) { |
|
| 62 | + $this->mappings['alignWithMargins'] = function($value) { |
|
| 63 | 63 | $this->object->setAlignWithMargins($value); |
| 64 | 64 | }; |
| 65 | 65 | } |
@@ -56,10 +56,12 @@ |
||
| 56 | 56 | |
| 57 | 57 | protected function initializeMappings() |
| 58 | 58 | { |
| 59 | - $this->mappings['scaleWithDocument'] = function ($value) { |
|
| 59 | + $this->mappings['scaleWithDocument'] = function ($value) |
|
| 60 | + { |
|
| 60 | 61 | $this->object->setScaleWithDocument($value); |
| 61 | 62 | }; |
| 62 | - $this->mappings['alignWithMargins'] = function ($value) { |
|
| 63 | + $this->mappings['alignWithMargins'] = function ($value) |
|
| 64 | + { |
|
| 63 | 65 | $this->object->setAlignWithMargins($value); |
| 64 | 66 | }; |
| 65 | 67 | } |
@@ -45,16 +45,16 @@ |
||
| 45 | 45 | $compiler->addDebugInfo($this) |
| 46 | 46 | ->write('$documentProperties = ') |
| 47 | 47 | ->subcompile($this->getNode('properties')) |
| 48 | - ->raw(';' . PHP_EOL) |
|
| 49 | - ->write('$context[\'phpExcel\'] = new MewesK\TwigExcelBundle\Wrapper\PhpExcelWrapper($context, $this->getEnvironment());' . PHP_EOL) |
|
| 50 | - ->write('$context[\'phpExcel\']->startDocument($documentProperties);' . PHP_EOL) |
|
| 51 | - ->write('unset($documentProperties);' . PHP_EOL) |
|
| 48 | + ->raw(';'.PHP_EOL) |
|
| 49 | + ->write('$context[\'phpExcel\'] = new MewesK\TwigExcelBundle\Wrapper\PhpExcelWrapper($context, $this->getEnvironment());'.PHP_EOL) |
|
| 50 | + ->write('$context[\'phpExcel\']->startDocument($documentProperties);'.PHP_EOL) |
|
| 51 | + ->write('unset($documentProperties);'.PHP_EOL) |
|
| 52 | 52 | ->subcompile($this->getNode('body')) |
| 53 | 53 | ->addDebugInfo($this) |
| 54 | - ->write('$context[\'phpExcel\']->endDocument(' . |
|
| 55 | - ($this->preCalculateFormulas ? 'true' : 'false') . ', ' . |
|
| 56 | - ($this->diskCachingDirectory ? '\'' . $this->diskCachingDirectory . '\'' : 'null') . ');' . PHP_EOL) |
|
| 57 | - ->write('unset($context[\'phpExcel\']);' . PHP_EOL); |
|
| 54 | + ->write('$context[\'phpExcel\']->endDocument('. |
|
| 55 | + ($this->preCalculateFormulas ? 'true' : 'false').', '. |
|
| 56 | + ($this->diskCachingDirectory ? '\''.$this->diskCachingDirectory.'\'' : 'null').');'.PHP_EOL) |
|
| 57 | + ->write('unset($context[\'phpExcel\']);'.PHP_EOL); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /** |
@@ -79,167 +79,167 @@ 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 | return $key === 'default' ? $this->object->getDefaultColumnDimension() : $this->object->getColumnDimension($key); |
| 84 | 84 | }; |
| 85 | - $this->mappings['columnDimension']['autoSize'] = function ($key, $value) { |
|
| 85 | + $this->mappings['columnDimension']['autoSize'] = function($key, $value) { |
|
| 86 | 86 | $this->mappings['columnDimension']['__object']($key)->setAutoSize($value); |
| 87 | 87 | }; |
| 88 | - $this->mappings['columnDimension']['collapsed'] = function ($key, $value) { |
|
| 88 | + $this->mappings['columnDimension']['collapsed'] = function($key, $value) { |
|
| 89 | 89 | $this->mappings['columnDimension']['__object']($key)->setCollapsed($value); |
| 90 | 90 | }; |
| 91 | - $this->mappings['columnDimension']['columnIndex'] = function ($key, $value) { |
|
| 91 | + $this->mappings['columnDimension']['columnIndex'] = function($key, $value) { |
|
| 92 | 92 | $this->mappings['columnDimension']['__object']($key)->setColumnIndex($value); |
| 93 | 93 | }; |
| 94 | - $this->mappings['columnDimension']['outlineLevel'] = function ($key, $value) { |
|
| 94 | + $this->mappings['columnDimension']['outlineLevel'] = function($key, $value) { |
|
| 95 | 95 | $this->mappings['columnDimension']['__object']($key)->setOutlineLevel($value); |
| 96 | 96 | }; |
| 97 | - $this->mappings['columnDimension']['visible'] = function ($key, $value) { |
|
| 97 | + $this->mappings['columnDimension']['visible'] = function($key, $value) { |
|
| 98 | 98 | $this->mappings['columnDimension']['__object']($key)->setVisible($value); |
| 99 | 99 | }; |
| 100 | - $this->mappings['columnDimension']['width'] = function ($key, $value) { |
|
| 100 | + $this->mappings['columnDimension']['width'] = function($key, $value) { |
|
| 101 | 101 | $this->mappings['columnDimension']['__object']($key)->setWidth($value); |
| 102 | 102 | }; |
| 103 | - $this->mappings['columnDimension']['xfIndex'] = function ($key, $value) { |
|
| 103 | + $this->mappings['columnDimension']['xfIndex'] = function($key, $value) { |
|
| 104 | 104 | $this->mappings['columnDimension']['__object']($key)->setXfIndex($value); |
| 105 | 105 | }; |
| 106 | - $this->mappings['pageMargins']['top'] = function ($value) { |
|
| 106 | + $this->mappings['pageMargins']['top'] = function($value) { |
|
| 107 | 107 | $this->object->getPageMargins()->setTop($value); |
| 108 | 108 | }; |
| 109 | - $this->mappings['pageMargins']['bottom'] = function ($value) { |
|
| 109 | + $this->mappings['pageMargins']['bottom'] = function($value) { |
|
| 110 | 110 | $this->object->getPageMargins()->setBottom($value); |
| 111 | 111 | }; |
| 112 | - $this->mappings['pageMargins']['left'] = function ($value) { |
|
| 112 | + $this->mappings['pageMargins']['left'] = function($value) { |
|
| 113 | 113 | $this->object->getPageMargins()->setLeft($value); |
| 114 | 114 | }; |
| 115 | - $this->mappings['pageMargins']['right'] = function ($value) { |
|
| 115 | + $this->mappings['pageMargins']['right'] = function($value) { |
|
| 116 | 116 | $this->object->getPageMargins()->setRight($value); |
| 117 | 117 | }; |
| 118 | - $this->mappings['pageMargins']['header'] = function ($value) { |
|
| 118 | + $this->mappings['pageMargins']['header'] = function($value) { |
|
| 119 | 119 | $this->object->getPageMargins()->setHeader($value); |
| 120 | 120 | }; |
| 121 | - $this->mappings['pageMargins']['footer'] = function ($value) { |
|
| 121 | + $this->mappings['pageMargins']['footer'] = function($value) { |
|
| 122 | 122 | $this->object->getPageMargins()->setFooter($value); |
| 123 | 123 | }; |
| 124 | - $this->mappings['pageSetup']['fitToHeight'] = function ($value) { |
|
| 124 | + $this->mappings['pageSetup']['fitToHeight'] = function($value) { |
|
| 125 | 125 | $this->object->getPageSetup()->setFitToHeight($value); |
| 126 | 126 | }; |
| 127 | - $this->mappings['pageSetup']['fitToPage'] = function ($value) { |
|
| 127 | + $this->mappings['pageSetup']['fitToPage'] = function($value) { |
|
| 128 | 128 | $this->object->getPageSetup()->setFitToPage($value); |
| 129 | 129 | }; |
| 130 | - $this->mappings['pageSetup']['fitToWidth'] = function ($value) { |
|
| 130 | + $this->mappings['pageSetup']['fitToWidth'] = function($value) { |
|
| 131 | 131 | $this->object->getPageSetup()->setFitToWidth($value); |
| 132 | 132 | }; |
| 133 | - $this->mappings['pageSetup']['horizontalCentered'] = function ($value) { |
|
| 133 | + $this->mappings['pageSetup']['horizontalCentered'] = function($value) { |
|
| 134 | 134 | $this->object->getPageSetup()->setHorizontalCentered($value); |
| 135 | 135 | }; |
| 136 | - $this->mappings['pageSetup']['orientation'] = function ($value) { |
|
| 136 | + $this->mappings['pageSetup']['orientation'] = function($value) { |
|
| 137 | 137 | $this->object->getPageSetup()->setOrientation($value); |
| 138 | 138 | }; |
| 139 | - $this->mappings['pageSetup']['paperSize'] = function ($value) { |
|
| 139 | + $this->mappings['pageSetup']['paperSize'] = function($value) { |
|
| 140 | 140 | $this->object->getPageSetup()->setPaperSize($value); |
| 141 | 141 | }; |
| 142 | - $this->mappings['pageSetup']['printArea'] = function ($value) { |
|
| 142 | + $this->mappings['pageSetup']['printArea'] = function($value) { |
|
| 143 | 143 | $this->object->getPageSetup()->setPrintArea($value); |
| 144 | 144 | }; |
| 145 | - $this->mappings['pageSetup']['scale'] = function ($value) { |
|
| 145 | + $this->mappings['pageSetup']['scale'] = function($value) { |
|
| 146 | 146 | $this->object->getPageSetup()->setScale($value); |
| 147 | 147 | }; |
| 148 | - $this->mappings['pageSetup']['verticalCentered'] = function ($value) { |
|
| 148 | + $this->mappings['pageSetup']['verticalCentered'] = function($value) { |
|
| 149 | 149 | $this->object->getPageSetup()->setVerticalCentered($value); |
| 150 | 150 | }; |
| 151 | - $this->mappings['printGridlines'] = function ($value) { |
|
| 151 | + $this->mappings['printGridlines'] = function($value) { |
|
| 152 | 152 | $this->object->setPrintGridlines($value); |
| 153 | 153 | }; |
| 154 | - $this->mappings['protection']['autoFilter'] = function ($value) { |
|
| 154 | + $this->mappings['protection']['autoFilter'] = function($value) { |
|
| 155 | 155 | $this->object->getProtection()->setAutoFilter($value); |
| 156 | 156 | }; |
| 157 | - $this->mappings['protection']['deleteColumns'] = function ($value) { |
|
| 157 | + $this->mappings['protection']['deleteColumns'] = function($value) { |
|
| 158 | 158 | $this->object->getProtection()->setDeleteColumns($value); |
| 159 | 159 | }; |
| 160 | - $this->mappings['protection']['deleteRows'] = function ($value) { |
|
| 160 | + $this->mappings['protection']['deleteRows'] = function($value) { |
|
| 161 | 161 | $this->object->getProtection()->setDeleteRows($value); |
| 162 | 162 | }; |
| 163 | - $this->mappings['protection']['formatCells'] = function ($value) { |
|
| 163 | + $this->mappings['protection']['formatCells'] = function($value) { |
|
| 164 | 164 | $this->object->getProtection()->setFormatCells($value); |
| 165 | 165 | }; |
| 166 | - $this->mappings['protection']['formatColumns'] = function ($value) { |
|
| 166 | + $this->mappings['protection']['formatColumns'] = function($value) { |
|
| 167 | 167 | $this->object->getProtection()->setFormatColumns($value); |
| 168 | 168 | }; |
| 169 | - $this->mappings['protection']['formatRows'] = function ($value) { |
|
| 169 | + $this->mappings['protection']['formatRows'] = function($value) { |
|
| 170 | 170 | $this->object->getProtection()->setFormatRows($value); |
| 171 | 171 | }; |
| 172 | - $this->mappings['protection']['insertColumns'] = function ($value) { |
|
| 172 | + $this->mappings['protection']['insertColumns'] = function($value) { |
|
| 173 | 173 | $this->object->getProtection()->setInsertColumns($value); |
| 174 | 174 | }; |
| 175 | - $this->mappings['protection']['insertHyperlinks'] = function ($value) { |
|
| 175 | + $this->mappings['protection']['insertHyperlinks'] = function($value) { |
|
| 176 | 176 | $this->object->getProtection()->setInsertHyperlinks($value); |
| 177 | 177 | }; |
| 178 | - $this->mappings['protection']['insertRows'] = function ($value) { |
|
| 178 | + $this->mappings['protection']['insertRows'] = function($value) { |
|
| 179 | 179 | $this->object->getProtection()->setInsertRows($value); |
| 180 | 180 | }; |
| 181 | - $this->mappings['protection']['objects'] = function ($value) { |
|
| 181 | + $this->mappings['protection']['objects'] = function($value) { |
|
| 182 | 182 | $this->object->getProtection()->setObjects($value); |
| 183 | 183 | }; |
| 184 | - $this->mappings['protection']['password'] = function ($value) { |
|
| 184 | + $this->mappings['protection']['password'] = function($value) { |
|
| 185 | 185 | $this->object->getProtection()->setPassword($value); |
| 186 | 186 | }; |
| 187 | - $this->mappings['protection']['pivotTables'] = function ($value) { |
|
| 187 | + $this->mappings['protection']['pivotTables'] = function($value) { |
|
| 188 | 188 | $this->object->getProtection()->setPivotTables($value); |
| 189 | 189 | }; |
| 190 | - $this->mappings['protection']['scenarios'] = function ($value) { |
|
| 190 | + $this->mappings['protection']['scenarios'] = function($value) { |
|
| 191 | 191 | $this->object->getProtection()->setScenarios($value); |
| 192 | 192 | }; |
| 193 | - $this->mappings['protection']['selectLockedCells'] = function ($value) { |
|
| 193 | + $this->mappings['protection']['selectLockedCells'] = function($value) { |
|
| 194 | 194 | $this->object->getProtection()->setSelectLockedCells($value); |
| 195 | 195 | }; |
| 196 | - $this->mappings['protection']['selectUnlockedCells'] = function ($value) { |
|
| 196 | + $this->mappings['protection']['selectUnlockedCells'] = function($value) { |
|
| 197 | 197 | $this->object->getProtection()->setSelectUnlockedCells($value); |
| 198 | 198 | }; |
| 199 | - $this->mappings['protection']['sheet'] = function ($value) { |
|
| 199 | + $this->mappings['protection']['sheet'] = function($value) { |
|
| 200 | 200 | $this->object->getProtection()->setSheet($value); |
| 201 | 201 | }; |
| 202 | - $this->mappings['protection']['sort'] = function ($value) { |
|
| 202 | + $this->mappings['protection']['sort'] = function($value) { |
|
| 203 | 203 | $this->object->getProtection()->setSort($value); |
| 204 | 204 | }; |
| 205 | - $this->mappings['rightToLeft'] = function ($value) { |
|
| 205 | + $this->mappings['rightToLeft'] = function($value) { |
|
| 206 | 206 | $this->object->setRightToLeft($value); |
| 207 | 207 | }; |
| 208 | 208 | $this->mappings['rowDimension']['__multi'] = true; |
| 209 | - $this->mappings['rowDimension']['__object'] = function ($key) { |
|
| 209 | + $this->mappings['rowDimension']['__object'] = function($key) { |
|
| 210 | 210 | return $key === 'default' ? $this->object->getDefaultRowDimension() : $this->object->getRowDimension($key); |
| 211 | 211 | }; |
| 212 | - $this->mappings['rowDimension']['collapsed'] = function ($key, $value) { |
|
| 212 | + $this->mappings['rowDimension']['collapsed'] = function($key, $value) { |
|
| 213 | 213 | $this->mappings['rowDimension']['__object']($key)->setCollapsed($value); |
| 214 | 214 | }; |
| 215 | - $this->mappings['rowDimension']['outlineLevel'] = function ($key, $value) { |
|
| 215 | + $this->mappings['rowDimension']['outlineLevel'] = function($key, $value) { |
|
| 216 | 216 | $this->mappings['rowDimension']['__object']($key)->setOutlineLevel($value); |
| 217 | 217 | }; |
| 218 | - $this->mappings['rowDimension']['rowHeight'] = function ($key, $value) { |
|
| 218 | + $this->mappings['rowDimension']['rowHeight'] = function($key, $value) { |
|
| 219 | 219 | $this->mappings['rowDimension']['__object']($key)->setRowHeight($value); |
| 220 | 220 | }; |
| 221 | - $this->mappings['rowDimension']['rowIndex'] = function ($key, $value) { |
|
| 221 | + $this->mappings['rowDimension']['rowIndex'] = function($key, $value) { |
|
| 222 | 222 | $this->mappings['rowDimension']['__object']($key)->setRowIndex($value); |
| 223 | 223 | }; |
| 224 | - $this->mappings['rowDimension']['visible'] = function ($key, $value) { |
|
| 224 | + $this->mappings['rowDimension']['visible'] = function($key, $value) { |
|
| 225 | 225 | $this->mappings['rowDimension']['__object']($key)->setVisible($value); |
| 226 | 226 | }; |
| 227 | - $this->mappings['rowDimension']['xfIndex'] = function ($key, $value) { |
|
| 227 | + $this->mappings['rowDimension']['xfIndex'] = function($key, $value) { |
|
| 228 | 228 | $this->mappings['rowDimension']['__object']($key)->setXfIndex($value); |
| 229 | 229 | }; |
| 230 | - $this->mappings['rowDimension']['zeroHeight'] = function ($key, $value) { |
|
| 230 | + $this->mappings['rowDimension']['zeroHeight'] = function($key, $value) { |
|
| 231 | 231 | $this->mappings['rowDimension']['__object']($key)->setZeroHeight($value); |
| 232 | 232 | }; |
| 233 | - $this->mappings['sheetState'] = function ($value) { |
|
| 233 | + $this->mappings['sheetState'] = function($value) { |
|
| 234 | 234 | $this->object->setSheetState($value); |
| 235 | 235 | }; |
| 236 | - $this->mappings['showGridlines'] = function ($value) { |
|
| 236 | + $this->mappings['showGridlines'] = function($value) { |
|
| 237 | 237 | $this->object->setShowGridlines($value); |
| 238 | 238 | }; |
| 239 | - $this->mappings['tabColor'] = function ($value) { |
|
| 239 | + $this->mappings['tabColor'] = function($value) { |
|
| 240 | 240 | $this->object->getTabColor()->setRGB($value); |
| 241 | 241 | }; |
| 242 | - $this->mappings['zoomScale'] = function ($value) { |
|
| 242 | + $this->mappings['zoomScale'] = function($value) { |
|
| 243 | 243 | $this->object->getSheetView()->setZoomScale($value); |
| 244 | 244 | }; |
| 245 | 245 | } |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | */ |
| 252 | 252 | public function start($index, array $properties = null) |
| 253 | 253 | { |
| 254 | - if (is_int($index) && $index <$this->documentWrapper->getObject()->getSheetCount()) { |
|
| 254 | + if (is_int($index) && $index < $this->documentWrapper->getObject()->getSheetCount()) { |
|
| 255 | 255 | $this->object = $this->documentWrapper->getObject()->setActiveSheetIndex($index); |
| 256 | 256 | } elseif (is_string($index)) { |
| 257 | 257 | if (!$this->documentWrapper->getObject()->sheetNameExists($index)) { |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | $this->documentWrapper->getObject()->createSheet()->setTitle($index); |
| 260 | 260 | } |
| 261 | 261 | $this->object = $this->documentWrapper->getObject()->setActiveSheetIndexByName($index); |
| 262 | - } else { |
|
| 262 | + } else { |
|
| 263 | 263 | // create new sheet without a name |
| 264 | 264 | $this->documentWrapper->getObject()->createSheet(); |
| 265 | 265 | $this->object = $this->documentWrapper->getObject()->setActiveSheetIndex(0); |
@@ -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); |