@@ -28,11 +28,11 @@ |
||
| 28 | 28 | public function compile(Twig_Compiler $compiler) |
| 29 | 29 | { |
| 30 | 30 | $compiler->addDebugInfo($this) |
| 31 | - ->write('$phpExcel->startAlignment(\'right\');' . PHP_EOL) |
|
| 31 | + ->write('$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('$phpExcel->endAlignment($rightValue);' . PHP_EOL) |
|
| 36 | - ->write('unset($rightValue);' . PHP_EOL); |
|
| 34 | + ->write('$rightValue = trim(ob_get_clean());'.PHP_EOL) |
|
| 35 | + ->write('$phpExcel->endAlignment($rightValue);'.PHP_EOL) |
|
| 36 | + ->write('unset($rightValue);'.PHP_EOL); |
|
| 37 | 37 | } |
| 38 | 38 | } |
@@ -32,11 +32,11 @@ |
||
| 32 | 32 | $compiler->addDebugInfo($this) |
| 33 | 33 | ->write('$rowIndex = ') |
| 34 | 34 | ->subcompile($this->getNode('index')) |
| 35 | - ->raw(';' . PHP_EOL) |
|
| 36 | - ->write('$phpExcel->startRow($rowIndex);' . PHP_EOL) |
|
| 37 | - ->write('unset($rowIndex);' . PHP_EOL) |
|
| 35 | + ->raw(';'.PHP_EOL) |
|
| 36 | + ->write('$phpExcel->startRow($rowIndex);'.PHP_EOL) |
|
| 37 | + ->write('unset($rowIndex);'.PHP_EOL) |
|
| 38 | 38 | ->subcompile($this->getNode('body')) |
| 39 | 39 | ->addDebugInfo($this) |
| 40 | - ->write('$phpExcel->endRow();' . PHP_EOL); |
|
| 40 | + ->write('$phpExcel->endRow();'.PHP_EOL); |
|
| 41 | 41 | } |
| 42 | 42 | } |
@@ -33,17 +33,17 @@ |
||
| 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('$phpExcel->startSheet($sheetIndex, $sheetProperties);' . PHP_EOL) |
|
| 41 | - ->write('unset($sheetIndex, $sheetProperties);' . PHP_EOL); |
|
| 39 | + ->raw(';'.PHP_EOL) |
|
| 40 | + ->write('$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('$phpExcel->endSheet();' . PHP_EOL); |
|
| 47 | + $compiler->addDebugInfo($this)->write('$phpExcel->endSheet();'.PHP_EOL); |
|
| 48 | 48 | } |
| 49 | 49 | } |
@@ -35,8 +35,8 @@ |
||
| 35 | 35 | protected function parseBody() |
| 36 | 36 | { |
| 37 | 37 | $tokenParser = $this; // PHP 5.3 fix |
| 38 | - $body = $this->parser->subparse(function (Twig_Token $token) use ($tokenParser) { |
|
| 39 | - return $token->test('end' . $tokenParser->getTag()); |
|
| 38 | + $body = $this->parser->subparse(function(Twig_Token $token) use ($tokenParser) { |
|
| 39 | + return $token->test('end'.$tokenParser->getTag()); |
|
| 40 | 40 | }, |
| 41 | 41 | true); |
| 42 | 42 | $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | /** |
| 69 | 69 | * @param Twig_Node $node |
| 70 | 70 | */ |
| 71 | - private function removeTextNodesRecursively(Twig_Node &$node) |
|
| 71 | + private function removeTextNodesRecursively(Twig_Node&$node) |
|
| 72 | 72 | { |
| 73 | 73 | foreach ($node->getIterator() as $key => $subNode) { |
| 74 | 74 | if ($subNode instanceof Twig_Node_Text) { |
@@ -51,55 +51,55 @@ |
||
| 51 | 51 | { |
| 52 | 52 | $wrapper = $this; // PHP 5.3 fix |
| 53 | 53 | |
| 54 | - $this->mappings['break'] = function ($value) use ($wrapper) { |
|
| 54 | + $this->mappings['break'] = function($value) use ($wrapper) { |
|
| 55 | 55 | $wrapper->sheetWrapper->getObject()->setBreak($wrapper->object->getCoordinate(), $value); |
| 56 | 56 | }; |
| 57 | - $this->mappings['dataType'] = function ($value) use ($wrapper) { |
|
| 57 | + $this->mappings['dataType'] = function($value) use ($wrapper) { |
|
| 58 | 58 | $wrapper->object->setDataType($value); |
| 59 | 59 | }; |
| 60 | - $this->mappings['dataValidation']['allowBlank'] = function ($value) use ($wrapper) { |
|
| 60 | + $this->mappings['dataValidation']['allowBlank'] = function($value) use ($wrapper) { |
|
| 61 | 61 | $wrapper->object->getDataValidation()->setAllowBlank($value); |
| 62 | 62 | }; |
| 63 | - $this->mappings['dataValidation']['error'] = function ($value) use ($wrapper) { |
|
| 63 | + $this->mappings['dataValidation']['error'] = function($value) use ($wrapper) { |
|
| 64 | 64 | $wrapper->object->getDataValidation()->setError($value); |
| 65 | 65 | }; |
| 66 | - $this->mappings['dataValidation']['errorStyle'] = function ($value) use ($wrapper) { |
|
| 66 | + $this->mappings['dataValidation']['errorStyle'] = function($value) use ($wrapper) { |
|
| 67 | 67 | $wrapper->object->getDataValidation()->setErrorStyle($value); |
| 68 | 68 | }; |
| 69 | - $this->mappings['dataValidation']['errorTitle'] = function ($value) use ($wrapper) { |
|
| 69 | + $this->mappings['dataValidation']['errorTitle'] = function($value) use ($wrapper) { |
|
| 70 | 70 | $wrapper->object->getDataValidation()->setErrorTitle($value); |
| 71 | 71 | }; |
| 72 | - $this->mappings['dataValidation']['formula1'] = function ($value) use ($wrapper) { |
|
| 72 | + $this->mappings['dataValidation']['formula1'] = function($value) use ($wrapper) { |
|
| 73 | 73 | $wrapper->object->getDataValidation()->setFormula1($value); |
| 74 | 74 | }; |
| 75 | - $this->mappings['dataValidation']['formula2'] = function ($value) use ($wrapper) { |
|
| 75 | + $this->mappings['dataValidation']['formula2'] = function($value) use ($wrapper) { |
|
| 76 | 76 | $wrapper->object->getDataValidation()->setFormula2($value); |
| 77 | 77 | }; |
| 78 | - $this->mappings['dataValidation']['operator'] = function ($value) use ($wrapper) { |
|
| 78 | + $this->mappings['dataValidation']['operator'] = function($value) use ($wrapper) { |
|
| 79 | 79 | $wrapper->object->getDataValidation()->setOperator($value); |
| 80 | 80 | }; |
| 81 | - $this->mappings['dataValidation']['prompt'] = function ($value) use ($wrapper) { |
|
| 81 | + $this->mappings['dataValidation']['prompt'] = function($value) use ($wrapper) { |
|
| 82 | 82 | $wrapper->object->getDataValidation()->setPrompt($value); |
| 83 | 83 | }; |
| 84 | - $this->mappings['dataValidation']['promptTitle'] = function ($value) use ($wrapper) { |
|
| 84 | + $this->mappings['dataValidation']['promptTitle'] = function($value) use ($wrapper) { |
|
| 85 | 85 | $wrapper->object->getDataValidation()->setPromptTitle($value); |
| 86 | 86 | }; |
| 87 | - $this->mappings['dataValidation']['showDropDown'] = function ($value) use ($wrapper) { |
|
| 87 | + $this->mappings['dataValidation']['showDropDown'] = function($value) use ($wrapper) { |
|
| 88 | 88 | $wrapper->object->getDataValidation()->setShowDropDown($value); |
| 89 | 89 | }; |
| 90 | - $this->mappings['dataValidation']['showErrorMessage'] = function ($value) use ($wrapper) { |
|
| 90 | + $this->mappings['dataValidation']['showErrorMessage'] = function($value) use ($wrapper) { |
|
| 91 | 91 | $wrapper->object->getDataValidation()->setShowErrorMessage($value); |
| 92 | 92 | }; |
| 93 | - $this->mappings['dataValidation']['showInputMessage'] = function ($value) use ($wrapper) { |
|
| 93 | + $this->mappings['dataValidation']['showInputMessage'] = function($value) use ($wrapper) { |
|
| 94 | 94 | $wrapper->object->getDataValidation()->setShowInputMessage($value); |
| 95 | 95 | }; |
| 96 | - $this->mappings['dataValidation']['type'] = function ($value) use ($wrapper) { |
|
| 96 | + $this->mappings['dataValidation']['type'] = function($value) use ($wrapper) { |
|
| 97 | 97 | $wrapper->object->getDataValidation()->setType($value); |
| 98 | 98 | }; |
| 99 | - $this->mappings['style'] = function ($value) use ($wrapper) { |
|
| 99 | + $this->mappings['style'] = function($value) use ($wrapper) { |
|
| 100 | 100 | $wrapper->sheetWrapper->getObject()->getStyle($wrapper->object->getCoordinate())->applyFromArray($value); |
| 101 | 101 | }; |
| 102 | - $this->mappings['url'] = function ($value) use ($wrapper) { |
|
| 102 | + $this->mappings['url'] = function($value) use ($wrapper) { |
|
| 103 | 103 | $wrapper->object->getHyperlink()->setUrl($value); |
| 104 | 104 | }; |
| 105 | 105 | } |
@@ -48,58 +48,58 @@ discard block |
||
| 48 | 48 | { |
| 49 | 49 | $wrapper = $this; // PHP 5.3 fix |
| 50 | 50 | |
| 51 | - $this->mappings['category'] = function ($value) use ($wrapper) { |
|
| 51 | + $this->mappings['category'] = function($value) use ($wrapper) { |
|
| 52 | 52 | $wrapper->object->getProperties()->setCategory($value); |
| 53 | 53 | }; |
| 54 | - $this->mappings['company'] = function ($value) use ($wrapper) { |
|
| 54 | + $this->mappings['company'] = function($value) use ($wrapper) { |
|
| 55 | 55 | $wrapper->object->getProperties()->setCompany($value); |
| 56 | 56 | }; |
| 57 | - $this->mappings['created'] = function ($value) use ($wrapper) { |
|
| 57 | + $this->mappings['created'] = function($value) use ($wrapper) { |
|
| 58 | 58 | $wrapper->object->getProperties()->setCreated($value); |
| 59 | 59 | }; |
| 60 | - $this->mappings['creator'] = function ($value) use ($wrapper) { |
|
| 60 | + $this->mappings['creator'] = function($value) use ($wrapper) { |
|
| 61 | 61 | $wrapper->object->getProperties()->setCreator($value); |
| 62 | 62 | }; |
| 63 | - $this->mappings['defaultStyle'] = function ($value) use ($wrapper) { |
|
| 63 | + $this->mappings['defaultStyle'] = function($value) use ($wrapper) { |
|
| 64 | 64 | $wrapper->object->getDefaultStyle()->applyFromArray($value); |
| 65 | 65 | }; |
| 66 | - $this->mappings['description'] = function ($value) use ($wrapper) { |
|
| 66 | + $this->mappings['description'] = function($value) use ($wrapper) { |
|
| 67 | 67 | $wrapper->object->getProperties()->setDescription($value); |
| 68 | 68 | }; |
| 69 | - $this->mappings['format'] = function ($value) use ($wrapper) { |
|
| 69 | + $this->mappings['format'] = function($value) use ($wrapper) { |
|
| 70 | 70 | $wrapper->attributes['format'] = $value; |
| 71 | 71 | }; |
| 72 | - $this->mappings['keywords'] = function ($value) use ($wrapper) { |
|
| 72 | + $this->mappings['keywords'] = function($value) use ($wrapper) { |
|
| 73 | 73 | $wrapper->object->getProperties()->setKeywords($value); |
| 74 | 74 | }; |
| 75 | - $this->mappings['lastModifiedBy'] = function ($value) use ($wrapper) { |
|
| 75 | + $this->mappings['lastModifiedBy'] = function($value) use ($wrapper) { |
|
| 76 | 76 | $wrapper->object->getProperties()->setLastModifiedBy($value); |
| 77 | 77 | }; |
| 78 | - $this->mappings['manager'] = function ($value) use ($wrapper) { |
|
| 78 | + $this->mappings['manager'] = function($value) use ($wrapper) { |
|
| 79 | 79 | $wrapper->object->getProperties()->setManager($value); |
| 80 | 80 | }; |
| 81 | - $this->mappings['modified'] = function ($value) use ($wrapper) { |
|
| 81 | + $this->mappings['modified'] = function($value) use ($wrapper) { |
|
| 82 | 82 | $wrapper->object->getProperties()->setModified($value); |
| 83 | 83 | }; |
| 84 | - $this->mappings['security']['lockRevision'] = function ($value) use ($wrapper) { |
|
| 84 | + $this->mappings['security']['lockRevision'] = function($value) use ($wrapper) { |
|
| 85 | 85 | $wrapper->object->getSecurity()->setLockRevision($value); |
| 86 | 86 | }; |
| 87 | - $this->mappings['security']['lockStructure'] = function ($value) use ($wrapper) { |
|
| 87 | + $this->mappings['security']['lockStructure'] = function($value) use ($wrapper) { |
|
| 88 | 88 | $wrapper->object->getSecurity()->setLockStructure($value); |
| 89 | 89 | }; |
| 90 | - $this->mappings['security']['lockWindows'] = function ($value) use ($wrapper) { |
|
| 90 | + $this->mappings['security']['lockWindows'] = function($value) use ($wrapper) { |
|
| 91 | 91 | $wrapper->object->getSecurity()->setLockWindows($value); |
| 92 | 92 | }; |
| 93 | - $this->mappings['security']['revisionsPassword'] = function ($value) use ($wrapper) { |
|
| 93 | + $this->mappings['security']['revisionsPassword'] = function($value) use ($wrapper) { |
|
| 94 | 94 | $wrapper->object->getSecurity()->setRevisionsPassword($value); |
| 95 | 95 | }; |
| 96 | - $this->mappings['security']['workbookPassword'] = function ($value) use ($wrapper) { |
|
| 96 | + $this->mappings['security']['workbookPassword'] = function($value) use ($wrapper) { |
|
| 97 | 97 | $wrapper->object->getSecurity()->setWorkbookPassword($value); |
| 98 | 98 | }; |
| 99 | - $this->mappings['subject'] = function ($value) use ($wrapper) { |
|
| 99 | + $this->mappings['subject'] = function($value) use ($wrapper) { |
|
| 100 | 100 | $wrapper->object->getProperties()->setSubject($value); |
| 101 | 101 | }; |
| 102 | - $this->mappings['title'] = function ($value) use ($wrapper) { |
|
| 102 | + $this->mappings['title'] = function($value) use ($wrapper) { |
|
| 103 | 103 | $wrapper->object->getProperties()->setTitle($value); |
| 104 | 104 | }; |
| 105 | 105 | } |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | else { |
| 141 | 141 | try { |
| 142 | 142 | $format = $this->context['app']->getRequest()->getRequestFormat(); |
| 143 | - } catch(\Exception $e) { |
|
| 143 | + } catch (\Exception $e) { |
|
| 144 | 144 | $format = null; |
| 145 | 145 | } |
| 146 | 146 | } |
@@ -57,52 +57,52 @@ discard block |
||
| 57 | 57 | { |
| 58 | 58 | $wrapper = $this; // PHP 5.3 fix |
| 59 | 59 | |
| 60 | - $this->mappings['coordinates'] = function ($value) use ($wrapper) { |
|
| 60 | + $this->mappings['coordinates'] = function($value) use ($wrapper) { |
|
| 61 | 61 | $wrapper->object->setCoordinates($value); |
| 62 | 62 | }; |
| 63 | - $this->mappings['description'] = function ($value) use ($wrapper) { |
|
| 63 | + $this->mappings['description'] = function($value) use ($wrapper) { |
|
| 64 | 64 | $wrapper->object->setDescription($value); |
| 65 | 65 | }; |
| 66 | - $this->mappings['height'] = function ($value) use ($wrapper) { |
|
| 66 | + $this->mappings['height'] = function($value) use ($wrapper) { |
|
| 67 | 67 | $wrapper->object->setHeight($value); |
| 68 | 68 | }; |
| 69 | - $this->mappings['name'] = function ($value) use ($wrapper) { |
|
| 69 | + $this->mappings['name'] = function($value) use ($wrapper) { |
|
| 70 | 70 | $wrapper->object->setName($value); |
| 71 | 71 | }; |
| 72 | - $this->mappings['offsetX'] = function ($value) use ($wrapper) { |
|
| 72 | + $this->mappings['offsetX'] = function($value) use ($wrapper) { |
|
| 73 | 73 | $wrapper->object->setOffsetX($value); |
| 74 | 74 | }; |
| 75 | - $this->mappings['offsetY'] = function ($value) use ($wrapper) { |
|
| 75 | + $this->mappings['offsetY'] = function($value) use ($wrapper) { |
|
| 76 | 76 | $wrapper->object->setOffsetY($value); |
| 77 | 77 | }; |
| 78 | - $this->mappings['resizeProportional'] = function ($value) use ($wrapper) { |
|
| 78 | + $this->mappings['resizeProportional'] = function($value) use ($wrapper) { |
|
| 79 | 79 | $wrapper->object->setResizeProportional($value); |
| 80 | 80 | }; |
| 81 | - $this->mappings['rotation'] = function ($value) use ($wrapper) { |
|
| 81 | + $this->mappings['rotation'] = function($value) use ($wrapper) { |
|
| 82 | 82 | $wrapper->object->setRotation($value); |
| 83 | 83 | }; |
| 84 | - $this->mappings['shadow']['alignment'] = function ($value) use ($wrapper) { |
|
| 84 | + $this->mappings['shadow']['alignment'] = function($value) use ($wrapper) { |
|
| 85 | 85 | $wrapper->object->getShadow()->setAlignment($value); |
| 86 | 86 | }; |
| 87 | - $this->mappings['shadow']['alpha'] = function ($value) use ($wrapper) { |
|
| 87 | + $this->mappings['shadow']['alpha'] = function($value) use ($wrapper) { |
|
| 88 | 88 | $wrapper->object->getShadow()->setAlpha($value); |
| 89 | 89 | }; |
| 90 | - $this->mappings['shadow']['blurRadius'] = function ($value) use ($wrapper) { |
|
| 90 | + $this->mappings['shadow']['blurRadius'] = function($value) use ($wrapper) { |
|
| 91 | 91 | $wrapper->object->getShadow()->setBlurRadius($value); |
| 92 | 92 | }; |
| 93 | - $this->mappings['shadow']['color'] = function ($value) use ($wrapper) { |
|
| 93 | + $this->mappings['shadow']['color'] = function($value) use ($wrapper) { |
|
| 94 | 94 | $wrapper->object->getShadow()->getColor()->setRGB($value); |
| 95 | 95 | }; |
| 96 | - $this->mappings['shadow']['direction'] = function ($value) use ($wrapper) { |
|
| 96 | + $this->mappings['shadow']['direction'] = function($value) use ($wrapper) { |
|
| 97 | 97 | $wrapper->object->getShadow()->setDirection($value); |
| 98 | 98 | }; |
| 99 | - $this->mappings['shadow']['distance'] = function ($value) use ($wrapper) { |
|
| 99 | + $this->mappings['shadow']['distance'] = function($value) use ($wrapper) { |
|
| 100 | 100 | $wrapper->object->getShadow()->setDistance($value); |
| 101 | 101 | }; |
| 102 | - $this->mappings['shadow']['visible'] = function ($value) use ($wrapper) { |
|
| 102 | + $this->mappings['shadow']['visible'] = function($value) use ($wrapper) { |
|
| 103 | 103 | $wrapper->object->getShadow()->setVisible($value); |
| 104 | 104 | }; |
| 105 | - $this->mappings['width'] = function ($value) use ($wrapper) { |
|
| 105 | + $this->mappings['width'] = function($value) use ($wrapper) { |
|
| 106 | 106 | $wrapper->object->setWidth($value); |
| 107 | 107 | }; |
| 108 | 108 | } |
@@ -197,21 +197,21 @@ discard block |
||
| 197 | 197 | { |
| 198 | 198 | // create temp path |
| 199 | 199 | $pathExtension = pathinfo($path, PATHINFO_EXTENSION); |
| 200 | - $tempPath = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'xlsdrawing' . '_' . md5($path) . ($pathExtension ? '.' . $pathExtension : ''); |
|
| 200 | + $tempPath = sys_get_temp_dir().DIRECTORY_SEPARATOR.'xlsdrawing'.'_'.md5($path).($pathExtension ? '.'.$pathExtension : ''); |
|
| 201 | 201 | |
| 202 | 202 | // create local copy |
| 203 | 203 | if (!file_exists($tempPath)) { |
| 204 | 204 | $data = file_get_contents($path); |
| 205 | 205 | if ($data === false) { |
| 206 | - throw new \InvalidArgumentException($path . ' does not exist.'); |
|
| 206 | + throw new \InvalidArgumentException($path.' does not exist.'); |
|
| 207 | 207 | } |
| 208 | 208 | $temp = fopen($tempPath, 'w+'); |
| 209 | 209 | if ($temp === false) { |
| 210 | - throw new \RuntimeException('Cannot open ' . $tempPath); |
|
| 210 | + throw new \RuntimeException('Cannot open '.$tempPath); |
|
| 211 | 211 | } |
| 212 | 212 | fwrite($temp, $data); |
| 213 | 213 | if (fclose($temp) === false) { |
| 214 | - throw new \RuntimeException('Cannot close ' . $tempPath); |
|
| 214 | + throw new \RuntimeException('Cannot close '.$tempPath); |
|
| 215 | 215 | } |
| 216 | 216 | unset($data, $temp); |
| 217 | 217 | } |
@@ -58,10 +58,10 @@ |
||
| 58 | 58 | { |
| 59 | 59 | $wrapper = $this; // PHP 5.3 fix |
| 60 | 60 | |
| 61 | - $this->mappings['scaleWithDocument'] = function ($value) use ($wrapper) { |
|
| 61 | + $this->mappings['scaleWithDocument'] = function($value) use ($wrapper) { |
|
| 62 | 62 | $wrapper->object->setScaleWithDocument($value); |
| 63 | 63 | }; |
| 64 | - $this->mappings['alignWithMargins'] = function ($value) use ($wrapper) { |
|
| 64 | + $this->mappings['alignWithMargins'] = function($value) use ($wrapper) { |
|
| 65 | 65 | $wrapper->object->setAlignWithMargins($value); |
| 66 | 66 | }; |
| 67 | 67 | } |