From 78f8b7c62cc240f7a10e85d34517a50d616a5791 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Er=C5=91ss=20Elem=C3=A9r?= Date: Tue, 2 Jul 2019 13:30:37 +0200 Subject: [PATCH 01/17] Update phpofficespreadsheet to 1.8.1 (security bugfix) --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 0786e69..8b5feba 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "php": ">=7.1", "symfony/framework-bundle": "~3.4|~4.0", "twig/twig": "~2.0", - "phpoffice/phpspreadsheet": "~1.7.0" + "phpoffice/phpspreadsheet": "~1.8.1" }, "require-dev": { "symfony/symfony": "~3.4|~4.0", From 0f754dadf3fd0732a866acc428065d9976410df5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Er=C5=91ss=20Elem=C3=A9r?= Date: Tue, 2 Jul 2019 16:13:25 +0200 Subject: [PATCH 02/17] modify namespace, fix some deprecations, fix some tests --- .gitignore | 1 + LICENSE | 2 +- README.md | 12 +-- composer.json | 4 +- phpunit.coverage.xml.dist | 2 +- phpunit.xml.dist | 2 +- src/DependencyInjection/Configuration.php | 9 +- ...php => ErelkeTwigSpreadsheetExtension.php} | 11 +-- src/ErelkeTwigSpreadsheetBundle.php | 12 +++ .../AddRequestFormatsListener.php | 2 +- src/Helper/Arrays.php | 6 +- src/Helper/Filesystem.php | 9 +- src/MewesKTwigSpreadsheetBundle.php | 12 --- src/Resources/config/services.yml | 8 +- src/Resources/doc/conf.py | 2 +- src/Resources/doc/configuration.rst | 4 +- src/Resources/doc/examples.rst | 2 +- src/Resources/doc/installation.rst | 4 +- src/Twig/Node/AlignmentNode.php | 12 +-- src/Twig/Node/BaseNode.php | 7 +- src/Twig/Node/CellNode.php | 8 +- src/Twig/Node/DocumentNode.php | 9 +- src/Twig/Node/DrawingNode.php | 8 +- src/Twig/Node/HeaderFooterNode.php | 12 +-- src/Twig/Node/RowNode.php | 8 +- src/Twig/Node/SheetNode.php | 8 +- .../NodeVisitor/MacroContextNodeVisitor.php | 25 ++++-- .../NodeVisitor/SyntaxCheckNodeVisitor.php | 44 +++++----- src/Twig/TokenParser/AlignmentTokenParser.php | 14 ++-- src/Twig/TokenParser/BaseTokenParser.php | 62 ++++++++------ src/Twig/TokenParser/CellTokenParser.php | 16 ++-- src/Twig/TokenParser/DocumentTokenParser.php | 13 +-- src/Twig/TokenParser/DrawingTokenParser.php | 13 +-- .../TokenParser/HeaderFooterTokenParser.php | 23 +++-- src/Twig/TokenParser/RowTokenParser.php | 13 +-- src/Twig/TokenParser/SheetTokenParser.php | 16 ++-- src/Twig/TwigSpreadsheetExtension.php | 56 +++++++------ src/Wrapper/BaseWrapper.php | 23 +++-- src/Wrapper/CellWrapper.php | 34 ++++---- src/Wrapper/DocumentWrapper.php | 55 +++++++----- src/Wrapper/DrawingWrapper.php | 34 ++++---- src/Wrapper/HeaderFooterWrapper.php | 53 ++++++------ src/Wrapper/PhpSpreadsheetWrapper.php | 84 +++++++++++-------- src/Wrapper/RowWrapper.php | 17 ++-- src/Wrapper/SheetWrapper.php | 40 +++++---- tests/Functional/BaseFunctionalTest.php | 10 +-- tests/Functional/ConfigFunctionalTest.php | 19 +++-- tests/Functional/Fixtures/TestAppKernel.php | 20 +++-- .../TestBundle/Controller/TestController.php | 13 +-- .../Fixtures/TestBundle/TestBundle.php | 2 +- .../Fixtures/config/config_config.yml | 2 +- tests/Functional/OdsXlsXlsxFunctionalTest.php | 14 ++-- tests/Twig/BaseTwigTest.php | 42 +++++----- tests/Twig/CsvOdsXlsXlsxErrorTwigTest.php | 42 +++++----- tests/Twig/CsvOdsXlsXlsxTwigTest.php | 10 ++- tests/Twig/OdsXlsXlsxTwigTest.php | 53 +++++++----- tests/Twig/PdfTwigTest.php | 8 +- tests/Twig/XlsXlsxTwigTest.php | 19 +++-- tests/Twig/XlsxTwigTest.php | 21 +++-- 59 files changed, 623 insertions(+), 463 deletions(-) rename src/DependencyInjection/{MewesKTwigSpreadsheetExtension.php => ErelkeTwigSpreadsheetExtension.php} (66%) create mode 100644 src/ErelkeTwigSpreadsheetBundle.php delete mode 100644 src/MewesKTwigSpreadsheetBundle.php diff --git a/.gitignore b/.gitignore index 496b505..b3337d8 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /composer.lock /phpunit.coverage.xml /phpunit.xml +/.idea diff --git a/LICENSE b/LICENSE index 0fafcac..38a7ccc 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2017 Mewes Kochheim +Copyright (c) 2017-2019 Mewes Kochheim, Erőss Elemér Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 9cbec36..906d77c 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # TwigSpreadsheetBundle -[![Teavis CI: Build Status](https://travis-ci.org/MewesK/TwigSpreadsheetBundle.png?branch=master)](https://travis-ci.org/MewesK/TwigSpreadsheetBundle) -[![Scrutinizer: Code Quality](https://scrutinizer-ci.com/g/MewesK/TwigSpreadsheetBundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/MewesK/TwigSpreadsheetBundle/?branch=master) -[![Code Coverage](https://scrutinizer-ci.com/g/MewesK/TwigSpreadsheetBundle/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/MewesK/TwigSpreadsheetBundle/?branch=master) -[![SensioLabsInsight: Code Quality](https://insight.sensiolabs.com/projects/f5c25ebe-0cbc-4be1-a094-4ef87d48ea1b/mini.png)](https://insight.sensiolabs.com/projects/f5c25ebe-0cbc-4be1-a094-4ef87d48ea1b) +[![Teavis CI: Build Status](https://travis-ci.org/erelke/TwigSpreadsheetBundle.png?branch=master)](https://travis-ci.org/erelke/TwigSpreadsheetBundle) +[![Scrutinizer: Code Quality](https://scrutinizer-ci.com/g/erelke/TwigSpreadsheetBundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/erelke/TwigSpreadsheetBundle/?branch=master) +[![Code Coverage](https://scrutinizer-ci.com/g/erelke/TwigSpreadsheetBundle/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/erelke/TwigSpreadsheetBundle/?branch=master) +[![SensioLabsInsight: Code Quality](https://insight.sensiolabs.com/projects/6f1d5477-967f-4754-bb95-505b1a50b71c/mini.png)](https://insight.sensiolabs.com/projects/6f1d5477-967f-4754-bb95-505b1a50b71c) This Symfony bundle integrates PhpSpreadsheet into Symfony using Twig. @@ -43,7 +43,7 @@ The following software is required to use PhpSpreadsheet/TwigSpreadsheetBundle. The source of the documentation is stored in the Resources/doc/ folder in this bundle: -[Resources/doc/index.rst](https://github.com/MewesK/TwigSpreadsheetBundle/blob/master/src/Resources/doc/index.rst) +[Resources/doc/index.rst](https://github.com/erelke/TwigSpreadsheetBundle/blob/master/src/Resources/doc/index.rst) You can find a prettier version on [readthedocs.org](httsp://readthedocs.org): @@ -57,4 +57,4 @@ All the installation instructions are located in the documentation. This bundle is under the MIT license. See the complete license in the bundle: -[Resources/meta/LICENSE](https://github.com/MewesK/TwigSpreadsheetBundle/blob/master/LICENSE) +[Resources/meta/LICENSE](https://github.com/erelke/TwigSpreadsheetBundle/blob/master/LICENSE) diff --git a/composer.json b/composer.json index 8b5feba..ba2f229 100644 --- a/composer.json +++ b/composer.json @@ -32,9 +32,9 @@ "mpdf/mpdf": "Add support for PDF rendering, requires ~7.0" }, "autoload": { - "psr-4": { "MewesK\\TwigSpreadsheetBundle\\": "src/" } + "psr-4": { "Erelke\\TwigSpreadsheetBundle\\": "src/" } }, "autoload-dev": { - "psr-4": { "MewesK\\TwigSpreadsheetBundle\\Tests\\": "tests/" } + "psr-4": { "Erelke\\TwigSpreadsheetBundle\\Tests\\": "tests/" } } } diff --git a/phpunit.coverage.xml.dist b/phpunit.coverage.xml.dist index 2235e9b..bf095b7 100644 --- a/phpunit.coverage.xml.dist +++ b/phpunit.coverage.xml.dist @@ -6,7 +6,7 @@ bootstrap="./vendor/autoload.php" > - + ./tests diff --git a/phpunit.xml.dist b/phpunit.xml.dist index f5edb98..8761b19 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -13,7 +13,7 @@ - + ./tests diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 680c29e..8cd4a54 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -1,7 +1,8 @@ root('mewes_k_twig_spreadsheet'); + $treeBuilder = new TreeBuilder('erelke_twig_spreadsheet'); + $rootNode = $treeBuilder->getRootNode(); $rootNode ->children() diff --git a/src/DependencyInjection/MewesKTwigSpreadsheetExtension.php b/src/DependencyInjection/ErelkeTwigSpreadsheetExtension.php similarity index 66% rename from src/DependencyInjection/MewesKTwigSpreadsheetExtension.php rename to src/DependencyInjection/ErelkeTwigSpreadsheetExtension.php index 0a1ec06..4111a36 100644 --- a/src/DependencyInjection/MewesKTwigSpreadsheetExtension.php +++ b/src/DependencyInjection/ErelkeTwigSpreadsheetExtension.php @@ -1,28 +1,29 @@ load('services.yml'); - $definition = $container->getDefinition('mewes_k_twig_spreadsheet.twig_spreadsheet_extension'); + $definition = $container->getDefinition('erelke_twig_spreadsheet.twig_spreadsheet_extension'); $definition->replaceArgument(0, $mergedConfig); } } diff --git a/src/ErelkeTwigSpreadsheetBundle.php b/src/ErelkeTwigSpreadsheetBundle.php new file mode 100644 index 0000000..40af7a2 --- /dev/null +++ b/src/ErelkeTwigSpreadsheetBundle.php @@ -0,0 +1,12 @@ + &$value) { - $array1[$key] = \is_array($value) && isset($array1[$key]) && \is_array($array1[$key]) ? + $array1[$key] = is_array($value) && isset($array1[$key]) && is_array($array1[$key]) ? self::mergeRecursive($array1[$key], $value) : $value; } diff --git a/src/Helper/Filesystem.php b/src/Helper/Filesystem.php index 36087b1..a764fd9 100644 --- a/src/Helper/Filesystem.php +++ b/src/Helper/Filesystem.php @@ -1,9 +1,10 @@ addDebugInfo($this) ->write(self::CODE_FIX_CONTEXT) diff --git a/src/Twig/Node/BaseNode.php b/src/Twig/Node/BaseNode.php index 1d0590e..badb8c0 100644 --- a/src/Twig/Node/BaseNode.php +++ b/src/Twig/Node/BaseNode.php @@ -1,13 +1,14 @@ addDebugInfo($this) ->write(self::CODE_FIX_CONTEXT) diff --git a/src/Twig/Node/DocumentNode.php b/src/Twig/Node/DocumentNode.php index 726a418..bf79c9e 100644 --- a/src/Twig/Node/DocumentNode.php +++ b/src/Twig/Node/DocumentNode.php @@ -1,8 +1,9 @@ addDebugInfo($this) ->write("ob_start();\n") diff --git a/src/Twig/Node/DrawingNode.php b/src/Twig/Node/DrawingNode.php index c3906e0..1535e28 100644 --- a/src/Twig/Node/DrawingNode.php +++ b/src/Twig/Node/DrawingNode.php @@ -1,6 +1,8 @@ addDebugInfo($this) ->write(self::CODE_FIX_CONTEXT) diff --git a/src/Twig/Node/HeaderFooterNode.php b/src/Twig/Node/HeaderFooterNode.php index 72bca1b..8c42884 100644 --- a/src/Twig/Node/HeaderFooterNode.php +++ b/src/Twig/Node/HeaderFooterNode.php @@ -1,8 +1,10 @@ addDebugInfo($this) ->write(self::CODE_FIX_CONTEXT) diff --git a/src/Twig/Node/RowNode.php b/src/Twig/Node/RowNode.php index dab77fb..e217a96 100644 --- a/src/Twig/Node/RowNode.php +++ b/src/Twig/Node/RowNode.php @@ -1,6 +1,8 @@ addDebugInfo($this) ->write(self::CODE_FIX_CONTEXT) diff --git a/src/Twig/Node/SheetNode.php b/src/Twig/Node/SheetNode.php index fef6a44..8db8e59 100644 --- a/src/Twig/Node/SheetNode.php +++ b/src/Twig/Node/SheetNode.php @@ -1,6 +1,8 @@ addDebugInfo($this) ->write(self::CODE_FIX_CONTEXT) diff --git a/src/Twig/NodeVisitor/MacroContextNodeVisitor.php b/src/Twig/NodeVisitor/MacroContextNodeVisitor.php index 44509ba..2d59f82 100644 --- a/src/Twig/NodeVisitor/MacroContextNodeVisitor.php +++ b/src/Twig/NodeVisitor/MacroContextNodeVisitor.php @@ -1,13 +1,20 @@ getTemplateLine()); + if ($node instanceof Twig_Node_Expression_MethodCall) { + $keyNode = new Twig_Node_Expression_Constant(PhpSpreadsheetWrapper::INSTANCE_KEY, $node->getTemplateLine()); // add wrapper even if it not exists, we fix that later - $valueNode = new \Twig_Node_Expression_Name(PhpSpreadsheetWrapper::INSTANCE_KEY, $node->getTemplateLine()); + $valueNode = new Twig_Node_Expression_Name(PhpSpreadsheetWrapper::INSTANCE_KEY, $node->getTemplateLine()); $valueNode->setAttribute('ignore_strict_check', true); /** - * @var \Twig_Node_Expression_Array $argumentsNode + * @var Twig_Node_Expression_Array $argumentsNode */ $argumentsNode = $node->getNode('arguments'); $argumentsNode->addElement($valueNode, $keyNode); @@ -43,7 +50,7 @@ protected function doEnterNode(\Twig_Node $node, \Twig_Environment $env) /** * {@inheritdoc} */ - protected function doLeaveNode(\Twig_Node $node, \Twig_Environment $env) + protected function doLeaveNode(Twig_Node $node, Twig_Environment $env) { return $node; } diff --git a/src/Twig/NodeVisitor/SyntaxCheckNodeVisitor.php b/src/Twig/NodeVisitor/SyntaxCheckNodeVisitor.php index aefed7d..a674373 100644 --- a/src/Twig/NodeVisitor/SyntaxCheckNodeVisitor.php +++ b/src/Twig/NodeVisitor/SyntaxCheckNodeVisitor.php @@ -1,14 +1,20 @@ checkAllowedChildren($node); } - } catch (\Twig_Error_Syntax $e) { + } catch (Twig_Error_Syntax $e) { // reset path since throwing an error prevents doLeaveNode to be called $this->path = []; throw $e; } - $this->path[] = $node !== null ? \get_class($node) : null; + $this->path[] = $node !== null ? get_class($node) : null; return $node; } @@ -50,7 +56,7 @@ protected function doEnterNode(\Twig_Node $node, \Twig_Environment $env) /** * {@inheritdoc} */ - protected function doLeaveNode(\Twig_Node $node, \ Twig_Environment $env) + protected function doLeaveNode(Twig_Node $node, Twig_Environment $env) { array_pop($this->path); @@ -58,27 +64,27 @@ protected function doLeaveNode(\Twig_Node $node, \ Twig_Environment $env) } /** - * @param \Twig_Node $node + * @param Twig_Node $node * - * @throws \Twig_Error_Syntax + * @throws Twig_Error_Syntax */ - private function checkAllowedChildren(\Twig_Node $node) + private function checkAllowedChildren(Twig_Node $node) { $hasDocumentNode = false; $hasTextNode = false; /** - * @var \Twig_Node $currentNode + * @var Twig_Node $currentNode */ foreach ($node->getIterator() as $currentNode) { - if ($currentNode instanceof \Twig_Node_Text) { + if ($currentNode instanceof Twig_Node_Text) { if ($hasDocumentNode) { - throw new \Twig_Error_Syntax(sprintf('Node "%s" is not allowed after Node "%s".', \Twig_Node_Text::class, DocumentNode::class)); + throw new Twig_Error_Syntax(sprintf('Node "%s" is not allowed after Node "%s".', Twig_Node_Text::class, DocumentNode::class)); } $hasTextNode = true; } elseif ($currentNode instanceof DocumentNode) { if ($hasTextNode) { - throw new \Twig_Error_Syntax(sprintf('Node "%s" is not allowed before Node "%s".', \Twig_Node_Text::class, DocumentNode::class)); + throw new Twig_Error_Syntax(sprintf('Node "%s" is not allowed before Node "%s".', Twig_Node_Text::class, DocumentNode::class)); } $hasDocumentNode = true; } @@ -88,7 +94,7 @@ private function checkAllowedChildren(\Twig_Node $node) /** * @param BaseNode $node * - * @throws \Twig_Error_Syntax + * @throws Twig_Error_Syntax */ private function checkAllowedParents(BaseNode $node) { @@ -96,7 +102,7 @@ private function checkAllowedParents(BaseNode $node) // find first parent from this bundle foreach (array_reverse($this->path) as $className) { - if (strpos($className, 'MewesK\\TwigSpreadsheetBundle\\Twig\\Node\\') === 0) { + if (strpos($className, 'Erelke\\TwigSpreadsheetBundle\\Twig\\Node\\') === 0) { $parentName = $className; break; } @@ -114,6 +120,6 @@ private function checkAllowedParents(BaseNode $node) } } - throw new \Twig_Error_Syntax(sprintf('Node "%s" is not allowed inside of Node "%s".', \get_class($node), $parentName)); + throw new Twig_Error_Syntax(sprintf('Node "%s" is not allowed inside of Node "%s".', get_class($node), $parentName)); } } diff --git a/src/Twig/TokenParser/AlignmentTokenParser.php b/src/Twig/TokenParser/AlignmentTokenParser.php index b64e88e..4efeb44 100644 --- a/src/Twig/TokenParser/AlignmentTokenParser.php +++ b/src/Twig/TokenParser/AlignmentTokenParser.php @@ -1,9 +1,11 @@ getAttributes(), $lineNo, $this->getTag(), $this->alignment); } diff --git a/src/Twig/TokenParser/BaseTokenParser.php b/src/Twig/TokenParser/BaseTokenParser.php index facbcc3..8912225 100644 --- a/src/Twig/TokenParser/BaseTokenParser.php +++ b/src/Twig/TokenParser/BaseTokenParser.php @@ -1,11 +1,21 @@ parseParameters($this->configureParameters($token)); @@ -90,22 +100,22 @@ public function parse(\Twig_Token $token) /** * @param array $parameterConfiguration * - * @throws \Exception - * @throws \InvalidArgumentException - * @throws \Twig_Error_Syntax + * @throws Exception + * @throws InvalidArgumentException + * @throws Twig_Error_Syntax * - * @return \Twig_Node_Expression[] + * @return Twig_Node_Expression[] */ private function parseParameters(array $parameterConfiguration = []): array { // parse expressions $expressions = []; - while (!$this->parser->getStream()->test(\Twig_Token::BLOCK_END_TYPE)) { + while (!$this->parser->getStream()->test(Twig_Token::BLOCK_END_TYPE)) { $expressions[] = $this->parser->getExpressionParser()->parseExpression(); } // end of expressions - $this->parser->getStream()->expect(\Twig_Token::BLOCK_END_TYPE); + $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); // map expressions to parameters $parameters = []; @@ -116,14 +126,14 @@ private function parseParameters(array $parameterConfiguration = []): array switch ($parameterOptions['type']) { case self::PARAMETER_TYPE_ARRAY: // check if expression is valid array - $valid = $expression instanceof \Twig_Node_Expression_Array; + $valid = $expression instanceof Twig_Node_Expression_Array; break; case self::PARAMETER_TYPE_VALUE: // check if expression is valid value - $valid = !($expression instanceof \Twig_Node_Expression_Array); + $valid = !($expression instanceof Twig_Node_Expression_Array); break; default: - throw new \InvalidArgumentException('Invalid parameter type'); + throw new InvalidArgumentException('Invalid parameter type'); } if ($valid) { @@ -135,27 +145,27 @@ private function parseParameters(array $parameterConfiguration = []): array // set default as parameter otherwise or throw exception if default is false if ($parameterOptions['default'] === false) { - throw new \Twig_Error_Syntax('A required parameter is missing'); + throw new Twig_Error_Syntax('A required parameter is missing'); } $parameters[$parameterName] = $parameterOptions['default']; } - if (\count($expressions) > 0) { - throw new \Twig_Error_Syntax('Too many parameters'); + if (count($expressions) > 0) { + throw new Twig_Error_Syntax('Too many parameters'); } return $parameters; } /** - * @return \Twig_Node - * @throws \Twig_Error_Syntax + * @return Twig_Node + * @throws Twig_Error_Syntax */ - private function parseBody(): \Twig_Node + private function parseBody(): Twig_Node { // parse till matching end tag is found - $body = $this->parser->subparse(function (\Twig_Token $token) { return $token->test('end'.$this->getTag()); }, true); - $this->parser->getStream()->expect(\Twig_Token::BLOCK_END_TYPE); + $body = $this->parser->subparse(function (Twig_Token $token) { return $token->test('end'.$this->getTag()); }, true); + $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); return $body; } } diff --git a/src/Twig/TokenParser/CellTokenParser.php b/src/Twig/TokenParser/CellTokenParser.php index d040c69..137416e 100644 --- a/src/Twig/TokenParser/CellTokenParser.php +++ b/src/Twig/TokenParser/CellTokenParser.php @@ -1,8 +1,12 @@ [ 'type' => self::PARAMETER_TYPE_VALUE, - 'default' => new \Twig_Node_Expression_Constant(null, $token->getLine()), + 'default' => new Twig_Node_Expression_Constant(null, $token->getLine()), ], 'properties' => [ 'type' => self::PARAMETER_TYPE_ARRAY, - 'default' => new \Twig_Node_Expression_Array([], $token->getLine()), + 'default' => new Twig_Node_Expression_Array([], $token->getLine()), ], ]; } @@ -29,7 +33,7 @@ public function configureParameters(\Twig_Token $token): array /** * {@inheritdoc} */ - public function createNode(array $nodes = [], int $lineNo = 0): \Twig_Node + public function createNode(array $nodes = [], int $lineNo = 0): Twig_Node { return new CellNode($nodes, $this->getAttributes(), $lineNo, $this->getTag()); } diff --git a/src/Twig/TokenParser/DocumentTokenParser.php b/src/Twig/TokenParser/DocumentTokenParser.php index a0804d8..7482e5a 100644 --- a/src/Twig/TokenParser/DocumentTokenParser.php +++ b/src/Twig/TokenParser/DocumentTokenParser.php @@ -1,8 +1,11 @@ [ 'type' => self::PARAMETER_TYPE_ARRAY, - 'default' => new \Twig_Node_Expression_Array([], $token->getLine()), + 'default' => new Twig_Node_Expression_Array([], $token->getLine()), ], ]; } @@ -25,7 +28,7 @@ public function configureParameters(\Twig_Token $token): array /** * {@inheritdoc} */ - public function createNode(array $nodes = [], int $lineNo = 0): \Twig_Node + public function createNode(array $nodes = [], int $lineNo = 0): Twig_Node { return new DocumentNode($nodes, $this->getAttributes(), $lineNo, $this->getTag()); } diff --git a/src/Twig/TokenParser/DrawingTokenParser.php b/src/Twig/TokenParser/DrawingTokenParser.php index 4442f83..7a35cdc 100644 --- a/src/Twig/TokenParser/DrawingTokenParser.php +++ b/src/Twig/TokenParser/DrawingTokenParser.php @@ -1,8 +1,11 @@ [ @@ -21,7 +24,7 @@ public function configureParameters(\Twig_Token $token): array ], 'properties' => [ 'type' => self::PARAMETER_TYPE_ARRAY, - 'default' => new \Twig_Node_Expression_Array([], $token->getLine()), + 'default' => new Twig_Node_Expression_Array([], $token->getLine()), ], ]; } @@ -29,7 +32,7 @@ public function configureParameters(\Twig_Token $token): array /** * {@inheritdoc} */ - public function createNode(array $nodes = [], int $lineNo = 0): \Twig_Node + public function createNode(array $nodes = [], int $lineNo = 0): Twig_Node { return new DrawingNode($nodes, $this->getAttributes(), $lineNo, $this->getTag()); } diff --git a/src/Twig/TokenParser/HeaderFooterTokenParser.php b/src/Twig/TokenParser/HeaderFooterTokenParser.php index 01e64ea..30a1df6 100644 --- a/src/Twig/TokenParser/HeaderFooterTokenParser.php +++ b/src/Twig/TokenParser/HeaderFooterTokenParser.php @@ -1,9 +1,14 @@ [ 'type' => self::PARAMETER_TYPE_VALUE, - 'default' => new \Twig_Node_Expression_Constant(null, $token->getLine()), + 'default' => new Twig_Node_Expression_Constant(null, $token->getLine()), ], 'properties' => [ 'type' => self::PARAMETER_TYPE_ARRAY, - 'default' => new \Twig_Node_Expression_Array([], $token->getLine()), + 'default' => new Twig_Node_Expression_Array([], $token->getLine()), ], ]; } @@ -50,9 +55,9 @@ public function configureParameters(\Twig_Token $token): array /** * {@inheritdoc} * - * @throws \InvalidArgumentException + * @throws InvalidArgumentException */ - public function createNode(array $nodes = [], int $lineNo = 0): \Twig_Node + public function createNode(array $nodes = [], int $lineNo = 0): Twig_Node { return new HeaderFooterNode($nodes, $this->getAttributes(), $lineNo, $this->getTag(), $this->baseType); } diff --git a/src/Twig/TokenParser/RowTokenParser.php b/src/Twig/TokenParser/RowTokenParser.php index 8b48b3e..657af06 100644 --- a/src/Twig/TokenParser/RowTokenParser.php +++ b/src/Twig/TokenParser/RowTokenParser.php @@ -1,8 +1,11 @@ [ 'type' => self::PARAMETER_TYPE_VALUE, - 'default' => new \Twig_Node_Expression_Constant(null, $token->getLine()), + 'default' => new Twig_Node_Expression_Constant(null, $token->getLine()), ], ]; } @@ -25,7 +28,7 @@ public function configureParameters(\Twig_Token $token): array /** * {@inheritdoc} */ - public function createNode(array $nodes = [], int $lineNo = 0): \Twig_Node + public function createNode(array $nodes = [], int $lineNo = 0): Twig_Node { return new RowNode($nodes, $this->getAttributes(), $lineNo, $this->getTag()); } diff --git a/src/Twig/TokenParser/SheetTokenParser.php b/src/Twig/TokenParser/SheetTokenParser.php index 59cb7a7..62c7ce5 100644 --- a/src/Twig/TokenParser/SheetTokenParser.php +++ b/src/Twig/TokenParser/SheetTokenParser.php @@ -1,8 +1,12 @@ [ 'type' => self::PARAMETER_TYPE_VALUE, - 'default' => new \Twig_Node_Expression_Constant(null, $token->getLine()), + 'default' => new Twig_Node_Expression_Constant(null, $token->getLine()), ], 'properties' => [ 'type' => self::PARAMETER_TYPE_ARRAY, - 'default' => new \Twig_Node_Expression_Array([], $token->getLine()), + 'default' => new Twig_Node_Expression_Array([], $token->getLine()), ], ]; } @@ -29,7 +33,7 @@ public function configureParameters(\Twig_Token $token): array /** * {@inheritdoc} */ - public function createNode(array $nodes = [], int $lineNo = 0): \Twig_Node + public function createNode(array $nodes = [], int $lineNo = 0): Twig_Node { return new SheetNode($nodes, $this->getAttributes(), $lineNo, $this->getTag()); } diff --git a/src/Twig/TwigSpreadsheetExtension.php b/src/Twig/TwigSpreadsheetExtension.php index d135fc8..7dc59ab 100644 --- a/src/Twig/TwigSpreadsheetExtension.php +++ b/src/Twig/TwigSpreadsheetExtension.php @@ -1,25 +1,29 @@ true]), - new \Twig_SimpleFunction('xlsrowindex', [$this, 'getCurrentRow'], ['needs_context' => true]), + new Twig_SimpleFunction('xlsmergestyles', [$this, 'mergeStyles']), + new Twig_SimpleFunction('xlscellindex', [$this, 'getCurrentColumn'], ['needs_context' => true]), + new Twig_SimpleFunction('xlsrowindex', [$this, 'getCurrentRow'], ['needs_context' => true]), ]; } /** * {@inheritdoc} * - * @throws \InvalidArgumentException + * @throws InvalidArgumentException */ public function getTokenParsers() { @@ -92,14 +96,14 @@ public function getNodeVisitors() * @param array $style1 * @param array $style2 * - * @throws \Twig_Error_Runtime + * @throws Twig_Error_Runtime * * @return array */ public function mergeStyles(array $style1, array $style2): array { - if (!\is_array($style1) || !\is_array($style2)) { - throw new \Twig_Error_Runtime('The xlsmergestyles function only works with arrays.'); + if (!is_array($style1) || !is_array($style2)) { + throw new Twig_Error_Runtime('The xlsmergestyles function only works with arrays.'); } return Arrays::mergeRecursive($style1, $style2); } @@ -107,13 +111,13 @@ public function mergeStyles(array $style1, array $style2): array /** * @param array $context * - * @throws \Twig_Error_Runtime + * @throws Twig_Error_Runtime * * @return int|null */ public function getCurrentColumn(array $context) { if (!isset($context[PhpSpreadsheetWrapper::INSTANCE_KEY])) { - throw new \Twig_Error_Runtime('The PhpSpreadsheetWrapper instance is missing.'); + throw new Twig_Error_Runtime('The PhpSpreadsheetWrapper instance is missing.'); } return $context[PhpSpreadsheetWrapper::INSTANCE_KEY]->getCurrentColumn(); } @@ -121,13 +125,13 @@ public function getCurrentColumn(array $context) { /** * @param array $context * - * @throws \Twig_Error_Runtime + * @throws Twig_Error_Runtime * * @return int|null */ public function getCurrentRow(array $context) { if (!isset($context[PhpSpreadsheetWrapper::INSTANCE_KEY])) { - throw new \Twig_Error_Runtime('The PhpSpreadsheetWrapper instance is missing.'); + throw new Twig_Error_Runtime('The PhpSpreadsheetWrapper instance is missing.'); } return $context[PhpSpreadsheetWrapper::INSTANCE_KEY]->getCurrentRow(); } diff --git a/src/Wrapper/BaseWrapper.php b/src/Wrapper/BaseWrapper.php index 57f9cb6..94a20b5 100644 --- a/src/Wrapper/BaseWrapper.php +++ b/src/Wrapper/BaseWrapper.php @@ -1,6 +1,11 @@ context = $context; $this->environment = $environment; @@ -88,7 +93,7 @@ protected function configureMappings(): array * @param array|null $mappings * @param string|null $column * - * @throws \RuntimeException + * @throws RuntimeException */ protected function setProperties(array $properties, array $mappings = null, string $column = null) { @@ -98,10 +103,10 @@ protected function setProperties(array $properties, array $mappings = null, stri foreach ($properties as $key => $value) { if (!isset($mappings[$key])) { - throw new \RuntimeException(sprintf('Missing mapping for key "%s"', $key)); + throw new RuntimeException(sprintf('Missing mapping for key "%s"', $key)); } - if (\is_array($value) && \is_array($mappings[$key])) { + if (is_array($value) && is_array($mappings[$key])) { // recursion if (isset($mappings[$key]['__multi'])) { // handle multi target structure (with columns) @@ -115,7 +120,7 @@ protected function setProperties(array $properties, array $mappings = null, stri // handle single target structure $this->setProperties($value, $mappings[$key]); } - } elseif (\is_callable($mappings[$key])) { + } elseif (is_callable($mappings[$key])) { // call single and multi target mapping // if column is set it is used to get object from the callback in __multi $mappings[$key]( @@ -123,7 +128,7 @@ protected function setProperties(array $properties, array $mappings = null, stri $column !== null ? $mappings['__multi']($column) : null ); } else { - throw new \RuntimeException(sprintf('Invalid mapping for key "%s"', $key)); + throw new RuntimeException(sprintf('Invalid mapping for key "%s"', $key)); } } } diff --git a/src/Wrapper/CellWrapper.php b/src/Wrapper/CellWrapper.php index 1a10cb8..eb0d73f 100644 --- a/src/Wrapper/CellWrapper.php +++ b/src/Wrapper/CellWrapper.php @@ -1,9 +1,15 @@ sheetWrapper->getObject() === null) { - throw new \LogicException(); + throw new LogicException(); } if ($index === null) { @@ -68,7 +74,7 @@ public function start(int $index = null, array $properties = []) /** * @param mixed|null $value * - * @throws \PhpOffice\PhpSpreadsheet\Exception + * @throws Exception */ public function value($value = null) { @@ -105,11 +111,11 @@ public function setObject(Cell $object = null) $this->object = $object; } - /** - * {@inheritdoc} - * - * @throws \PhpOffice\PhpSpreadsheet\Exception - */ + /** + * {@inheritdoc} + * + * @return array + */ protected function configureMappings(): array { return [ @@ -131,7 +137,7 @@ protected function configureMappings(): array 'type' => function ($value) { $this->object->getDataValidation()->setType($value); }, ], 'merge' => function ($value) { - if (\is_int($value)) { + if (is_int($value)) { $value = Coordinate::stringFromColumnIndex($value).$this->sheetWrapper->getRow(); } $this->sheetWrapper->getObject()->mergeCells(sprintf('%s:%s', $this->object->getCoordinate(), $value)); diff --git a/src/Wrapper/DocumentWrapper.php b/src/Wrapper/DocumentWrapper.php index eb42967..8d87a55 100644 --- a/src/Wrapper/DocumentWrapper.php +++ b/src/Wrapper/DocumentWrapper.php @@ -1,15 +1,24 @@ object === null) { - throw new \LogicException(); + throw new LogicException(); } $format = null; @@ -100,7 +109,7 @@ public function end() } // set default - if ($format === null || !\is_string($format)) { + if ($format === null || !is_string($format)) { $format = 'xlsx'; } else { $format = strtolower($format); @@ -109,7 +118,7 @@ public function end() // set up mPDF if ($format === 'pdf') { if (!class_exists('\Mpdf\Mpdf')) { - throw new \RuntimeException('Error loading mPDF. Is mPDF correctly installed?'); + throw new RuntimeException('Error loading mPDF. Is mPDF correctly installed?'); } IOFactory::registerWriter('Pdf', Mpdf::class); } @@ -162,11 +171,11 @@ public function setObject(Spreadsheet $object = null) $this->object = $object; } - /** - * {@inheritdoc} - * - * @throws \PhpOffice\PhpSpreadsheet\Exception - */ + /** + * {@inheritdoc} + * + * @return array + */ protected function configureMappings(): array { return [ @@ -207,9 +216,9 @@ private function expandPath(string $path): string { $loader = $this->environment->getLoader(); - if ($loader instanceof \Twig_Loader_Filesystem && mb_strpos($path, '@') === 0) { + if ($loader instanceof Twig_Loader_Filesystem && mb_strpos($path, '@') === 0) { /* - * @var \Twig_Loader_Filesystem + * @var Twig_Loader_Filesystem */ foreach ($loader->getNamespaces() as $namespace) { if (mb_strpos($path, $namespace) === 1) { diff --git a/src/Wrapper/DrawingWrapper.php b/src/Wrapper/DrawingWrapper.php index d7d015e..21ec297 100644 --- a/src/Wrapper/DrawingWrapper.php +++ b/src/Wrapper/DrawingWrapper.php @@ -1,10 +1,16 @@ sheetWrapper->getObject() === null) { - throw new \LogicException(); + throw new LogicException(); } // create local copy of the asset @@ -88,7 +94,7 @@ public function start(string $path, array $properties = []) $headerFooterParameters['value'][HeaderFooterWrapper::ALIGNMENT_RIGHT] .= '&G'; break; default: - throw new \InvalidArgumentException(sprintf('Unknown alignment type "%s"', $alignment)); + throw new InvalidArgumentException(sprintf('Unknown alignment type "%s"', $alignment)); } $location .= $headerFooterParameters['baseType'] === HeaderFooterWrapper::BASETYPE_HEADER ? 'H' : 'F'; @@ -161,8 +167,8 @@ protected function configureMappings(): array /** * @param string $path * - * @throws \InvalidArgumentException - * @throws \Symfony\Component\Filesystem\Exception\IOException + * @throws InvalidArgumentException + * @throws IOException * * @return string */ @@ -176,7 +182,7 @@ private function createTempCopy(string $path): string if (!Filesystem::exists($tempPath)) { $data = file_get_contents($path); if ($data === false) { - throw new \InvalidArgumentException($path.' does not exist.'); + throw new InvalidArgumentException($path.' does not exist.'); } Filesystem::dumpFile($tempPath, $data); unset($data); diff --git a/src/Wrapper/HeaderFooterWrapper.php b/src/Wrapper/HeaderFooterWrapper.php index df2612e..c79f60c 100644 --- a/src/Wrapper/HeaderFooterWrapper.php +++ b/src/Wrapper/HeaderFooterWrapper.php @@ -1,8 +1,13 @@ sheetWrapper->getObject() === null) { - throw new \LogicException(); + throw new LogicException(); } if ($type !== null) { $type = strtolower($type); - if (!\in_array($type, [self::TYPE_EVEN, self::TYPE_FIRST, self::TYPE_ODD], true)) { - throw new \InvalidArgumentException(sprintf('Unknown type "%s"', $type)); + if (!in_array($type, [self::TYPE_EVEN, self::TYPE_FIRST, self::TYPE_ODD], true)) { + throw new InvalidArgumentException(sprintf('Unknown type "%s"', $type)); } } @@ -116,13 +121,13 @@ public function start(string $baseType, string $type = null, array $properties = } /** - * @throws \InvalidArgumentException - * @throws \LogicException + * @throws InvalidArgumentException + * @throws LogicException */ public function end() { if ($this->object === null) { - throw new \LogicException(); + throw new LogicException(); } $value = implode('', $this->parameters['value']); @@ -173,13 +178,13 @@ public function end() * @param string $alignment * @param array $properties * - * @throws \InvalidArgumentException - * @throws \LogicException + * @throws InvalidArgumentException + * @throws LogicException */ public function startAlignment(string $alignment, array $properties = []) { if ($this->object === null) { - throw new \LogicException(); + throw new LogicException(); } $alignment = self::validateAlignment(strtolower($alignment)); @@ -203,13 +208,13 @@ public function startAlignment(string $alignment, array $properties = []) /** * @param string $value * - * @throws \InvalidArgumentException - * @throws \LogicException + * @throws InvalidArgumentException + * @throws LogicException */ public function endAlignment($value) { if ($this->object === null || !isset($this->alignmentParameters['type'])) { - throw new \LogicException(); + throw new LogicException(); } if (strpos($this->parameters['value'][$this->alignmentParameters['type']], '&G') === false) { diff --git a/src/Wrapper/PhpSpreadsheetWrapper.php b/src/Wrapper/PhpSpreadsheetWrapper.php index c65f9ff..8690e8b 100644 --- a/src/Wrapper/PhpSpreadsheetWrapper.php +++ b/src/Wrapper/PhpSpreadsheetWrapper.php @@ -1,6 +1,16 @@ documentWrapper = new DocumentWrapper($context, $environment, $attributes); $this->sheetWrapper = new SheetWrapper($context, $environment, $this->documentWrapper); @@ -95,9 +105,9 @@ public function getCurrentRow() /** * @param array $properties * - * @throws \PhpOffice\PhpSpreadsheet\Exception - * @throws \PhpOffice\PhpSpreadsheet\Reader\Exception - * @throws \RuntimeException + * @throws Exception + * @throws Reader_Exception + * @throws RuntimeException */ public function startDocument(array $properties = []) { @@ -105,12 +115,12 @@ public function startDocument(array $properties = []) } /** - * @throws \RuntimeException - * @throws \LogicException - * @throws \InvalidArgumentException - * @throws \PhpOffice\PhpSpreadsheet\Exception - * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception - * @throws \Symfony\Component\Filesystem\Exception\IOException + * @throws RuntimeException + * @throws LogicException + * @throws InvalidArgumentException + * @throws Exception + * @throws Writer_Exception + * @throws IOException */ public function endDocument() { @@ -121,9 +131,9 @@ public function endDocument() * @param int|string|null $index * @param array $properties * - * @throws \LogicException - * @throws \PhpOffice\PhpSpreadsheet\Exception - * @throws \RuntimeException + * @throws LogicException + * @throws Exception + * @throws RuntimeException */ public function startSheet($index = null, array $properties = []) { @@ -131,7 +141,7 @@ public function startSheet($index = null, array $properties = []) } /** - * @throws \LogicException + * @throws LogicException * @throws \Exception */ public function endSheet() @@ -142,7 +152,7 @@ public function endSheet() /** * @param int|null $index * - * @throws \LogicException + * @throws LogicException */ public function startRow(int $index = null) { @@ -150,7 +160,7 @@ public function startRow(int $index = null) } /** - * @throws \LogicException + * @throws LogicException */ public function endRow() { @@ -161,9 +171,9 @@ public function endRow() * @param int|null $index * @param array $properties * - * @throws \InvalidArgumentException - * @throws \LogicException - * @throws \RuntimeException + * @throws InvalidArgumentException + * @throws LogicException + * @throws RuntimeException */ public function startCell(int $index = null, array $properties = []) { @@ -173,7 +183,7 @@ public function startCell(int $index = null, array $properties = []) /** * @param null|mixed $value * - * @throws \PhpOffice\PhpSpreadsheet\Exception + * @throws Exception */ public function setCellValue($value = null) { @@ -190,9 +200,9 @@ public function endCell() * @param string|null $type * @param array $properties * - * @throws \LogicException - * @throws \RuntimeException - * @throws \InvalidArgumentException + * @throws LogicException + * @throws RuntimeException + * @throws InvalidArgumentException */ public function startHeaderFooter(string $baseType, string $type = null, array $properties = []) { @@ -200,8 +210,8 @@ public function startHeaderFooter(string $baseType, string $type = null, array $ } /** - * @throws \LogicException - * @throws \InvalidArgumentException + * @throws LogicException + * @throws InvalidArgumentException */ public function endHeaderFooter() { @@ -212,8 +222,8 @@ public function endHeaderFooter() * @param null|string $type * @param array $properties * - * @throws \InvalidArgumentException - * @throws \LogicException + * @throws InvalidArgumentException + * @throws LogicException */ public function startAlignment(string $type = null, array $properties = []) { @@ -223,8 +233,8 @@ public function startAlignment(string $type = null, array $properties = []) /** * @param null|string $value * - * @throws \InvalidArgumentException - * @throws \LogicException + * @throws InvalidArgumentException + * @throws LogicException */ public function endAlignment(string $value = null) { @@ -235,11 +245,11 @@ public function endAlignment(string $value = null) * @param string $path * @param array $properties * - * @throws \Symfony\Component\Filesystem\Exception\IOException - * @throws \InvalidArgumentException - * @throws \LogicException - * @throws \RuntimeException - * @throws \PhpOffice\PhpSpreadsheet\Exception + * @throws IOException + * @throws InvalidArgumentException + * @throws LogicException + * @throws RuntimeException + * @throws Exception */ public function startDrawing(string $path, array $properties = []) { diff --git a/src/Wrapper/RowWrapper.php b/src/Wrapper/RowWrapper.php index 7b14e7a..8ad6167 100644 --- a/src/Wrapper/RowWrapper.php +++ b/src/Wrapper/RowWrapper.php @@ -1,6 +1,9 @@ sheetWrapper->getObject() === null) { - throw new \LogicException(); + throw new LogicException(); } if ($index === null) { @@ -45,12 +48,12 @@ public function start(int $index = null) } /** - * @throws \LogicException + * @throws LogicException */ public function end() { if ($this->sheetWrapper->getObject() === null) { - throw new \LogicException(); + throw new LogicException(); } $this->sheetWrapper->setColumn(null); diff --git a/src/Wrapper/SheetWrapper.php b/src/Wrapper/SheetWrapper.php index 53d4fdc..4e06bc5 100644 --- a/src/Wrapper/SheetWrapper.php +++ b/src/Wrapper/SheetWrapper.php @@ -1,11 +1,17 @@ documentWrapper->getObject() === null) { - throw new \LogicException(); + throw new LogicException(); } - if (\is_int($index) && $index < $this->documentWrapper->getObject()->getSheetCount()) { + if (is_int($index) && $index < $this->documentWrapper->getObject()->getSheetCount()) { $this->object = $this->documentWrapper->getObject()->setActiveSheetIndex($index); - } elseif (\is_string($index)) { + } elseif (is_string($index)) { if (!$this->documentWrapper->getObject()->sheetNameExists($index)) { // create new sheet with a name $this->documentWrapper->getObject()->createSheet()->setTitle($index); @@ -93,18 +99,18 @@ public function start($index, array $properties = []) /** * @throws \Exception - * @throws \LogicException + * @throws LogicException */ public function end() { if ($this->object === null) { - throw new \LogicException(); + throw new LogicException(); } // auto-size columns if ( isset($this->parameters['properties']['columnDimension']) && - \is_array($this->parameters['properties']['columnDimension']) + is_array($this->parameters['properties']['columnDimension']) ) { /** * @var array $columnDimension @@ -194,11 +200,11 @@ public function setColumn($column) $this->column = $column; } - /** - * {@inheritdoc} - * - * @throws \PhpOffice\PhpSpreadsheet\Exception - */ + /** + * {@inheritdoc} + * + * @return array + */ protected function configureMappings(): array { return [ diff --git a/tests/Functional/BaseFunctionalTest.php b/tests/Functional/BaseFunctionalTest.php index a06b9dc..ad35cc8 100644 --- a/tests/Functional/BaseFunctionalTest.php +++ b/tests/Functional/BaseFunctionalTest.php @@ -1,9 +1,9 @@ getResponse($routeName, $routeParameters)->getContent(); + $content = $this->_getResponse($routeName, $routeParameters)->getContent(); // create path for temp file $format = strtolower($format); @@ -108,7 +108,7 @@ protected function getDocument(string $routeName, array $routeParameters = [], s * * @return Response */ - protected function getResponse(string $routeName, array $routeParameters = []): Response + protected function _getResponse(string $routeName, array $routeParameters = []): Response { /** * @var Router $router diff --git a/tests/Functional/ConfigFunctionalTest.php b/tests/Functional/ConfigFunctionalTest.php index 8c30fef..9407a11 100644 --- a/tests/Functional/ConfigFunctionalTest.php +++ b/tests/Functional/ConfigFunctionalTest.php @@ -1,8 +1,9 @@ getContainer()->get('mewes_k_twig_spreadsheet.twig_spreadsheet_extension'); + $extension = static::$kernel->getContainer()->get('erelke_twig_spreadsheet.twig_spreadsheet_extension'); static::assertFalse($extension->getAttributes()['pre_calculate_formulas'], 'Unexpected attribute'); @@ -34,31 +35,31 @@ public function testPreCalculateFormulas() } /** - * @throws \Exception + * @throws Exception */ public function testXmlCacheDirectory() { // make request to fill the disk cache - $response = $this->getResponse('test_default', ['templateName' => 'simple']); + $response = $this->_getResponse('test_default', ['templateName' => 'simple']); static::assertNotNull($response, 'Response does not exist'); /** * @var TwigSpreadsheetExtension $extension */ - $extension = static::$kernel->getContainer()->get('mewes_k_twig_spreadsheet.twig_spreadsheet_extension'); + $extension = static::$kernel->getContainer()->get('erelke_twig_spreadsheet.twig_spreadsheet_extension'); static::assertDirectoryExists($extension->getAttributes()['cache']['xml'], 'Cache directory does not exist'); } /** - * @throws \Exception + * @throws Exception */ public function testCsvWriterAttributes() { /** * @var TwigSpreadsheetExtension $extension */ - $extension = static::$kernel->getContainer()->get('mewes_k_twig_spreadsheet.twig_spreadsheet_extension'); + $extension = static::$kernel->getContainer()->get('erelke_twig_spreadsheet.twig_spreadsheet_extension'); static::assertEquals(';', $extension->getAttributes()['csv_writer']['delimiter'], 'Unexpected attribute'); static::assertEquals('\'', $extension->getAttributes()['csv_writer']['enclosure'], 'Unexpected attribute'); diff --git a/tests/Functional/Fixtures/TestAppKernel.php b/tests/Functional/Fixtures/TestAppKernel.php index f15c16a..a41cd41 100644 --- a/tests/Functional/Fixtures/TestAppKernel.php +++ b/tests/Functional/Fixtures/TestAppKernel.php @@ -1,7 +1,13 @@ getResponse('test_custom_response', ['templateName' => 'simple', '_format' => $format]); + $response = $this->_getResponse('test_custom_response', ['templateName' => 'simple', '_format' => $format]); static::assertNotNull($response, 'Response does not exist'); static::assertContains('foobar.bin', $response->headers->get('Content-Disposition'), 'Unexpected or missing header "Content-Disposition"'); @@ -65,7 +67,7 @@ public function testCustomResponse($format) /** * @param string $format * - * @throws \Exception + * @throws Exception * * @dataProvider formatProvider */ @@ -86,7 +88,7 @@ public function testDocumentTemplatePath1($format) /** * @param string $format * - * @throws \Exception + * @throws Exception * * @dataProvider formatProvider */ diff --git a/tests/Twig/BaseTwigTest.php b/tests/Twig/BaseTwigTest.php index b23756e..39240cd 100644 --- a/tests/Twig/BaseTwigTest.php +++ b/tests/Twig/BaseTwigTest.php @@ -1,15 +1,21 @@ addPath(sprintf('%s/%s', __DIR__, static::TEMPLATE_PATH), 'templates'); - static::$environment = new \Twig_Environment($twigFileSystem, ['debug' => true, 'strict_variables' => true]); + static::$environment = new Twig_Environment($twigFileSystem, ['debug' => true, 'strict_variables' => true]); static::$environment->addExtension(new TwigSpreadsheetExtension([ 'pre_calculate_formulas' => true, 'cache' => [ @@ -63,18 +69,16 @@ public static function setUpBeforeClass() static::$environment->setCache($cachePath.'/twig'); } - /** - * @param string $templateName - * @param string $format - * - * @throws \Twig_Error_Syntax - * @throws \Twig_Error_Loader - * @throws \Symfony\Component\Filesystem\Exception\IOException - * - * @return Spreadsheet|string - * @throws \Twig_Error_Runtime - * @throws \PhpOffice\PhpSpreadsheet\Reader\Exception - */ + /** + * @param string $templateName + * @param string $format + * + * @return Spreadsheet|string + * @throws Exception + * @throws Twig_Error_Loader + * @throws RuntimeError + * @throws SyntaxError + */ protected function getDocument($templateName, $format) { $format = strtolower($format); diff --git a/tests/Twig/CsvOdsXlsXlsxErrorTwigTest.php b/tests/Twig/CsvOdsXlsXlsxErrorTwigTest.php index 13411eb..bba83b1 100644 --- a/tests/Twig/CsvOdsXlsXlsxErrorTwigTest.php +++ b/tests/Twig/CsvOdsXlsXlsxErrorTwigTest.php @@ -1,6 +1,10 @@ expectException(\Twig_Error_Syntax::class); - $this->expectExceptionMessage('Node "MewesK\TwigSpreadsheetBundle\Twig\Node\DocumentNode" is not allowed inside of Node "MewesK\TwigSpreadsheetBundle\Twig\Node\SheetNode"'); + $this->expectException(Twig_Error_Syntax::class); + $this->expectExceptionMessage('Node "Erelke\TwigSpreadsheetBundle\Twig\Node\DocumentNode" is not allowed inside of Node "Erelke\TwigSpreadsheetBundle\Twig\Node\SheetNode"'); $this->getDocument('documentError', $format); } @@ -37,14 +41,14 @@ public function testDocumentError($format) /** * @param string $format * - * @throws \Exception + * @throws Exception * * @dataProvider formatProvider */ public function testDocumentErrorTextAfter($format) { - $this->expectException(\Twig_Error_Syntax::class); - $this->expectExceptionMessage('Node "Twig_Node_Text" is not allowed after Node "MewesK\TwigSpreadsheetBundle\Twig\Node\DocumentNode"'); + $this->expectException(Twig_Error_Syntax::class); + $this->expectExceptionMessage('Node "Twig\Node\TextNode" is not allowed after Node "Erelke\TwigSpreadsheetBundle\Twig\Node\DocumentNode"'); $this->getDocument('documentErrorTextAfter', $format); } @@ -52,14 +56,14 @@ public function testDocumentErrorTextAfter($format) /** * @param string $format * - * @throws \Exception + * @throws Exception * * @dataProvider formatProvider */ public function testDocumentErrorTextBefore($format) { - $this->expectException(\Twig_Error_Syntax::class); - $this->expectExceptionMessage('Node "Twig_Node_Text" is not allowed before Node "MewesK\TwigSpreadsheetBundle\Twig\Node\DocumentNode"'); + $this->expectException(Twig_Error_Syntax::class); + $this->expectExceptionMessage('Node "Twig\Node\TextNode" is not allowed before Node "Erelke\TwigSpreadsheetBundle\Twig\Node\DocumentNode"'); $this->getDocument('documentErrorTextBefore', $format); } @@ -67,14 +71,14 @@ public function testDocumentErrorTextBefore($format) /** * @param string $format * - * @throws \Exception + * @throws Exception * * @dataProvider formatProvider */ public function testStartCellIndexError($format) { - $this->expectException(\TypeError::class); - $this->expectExceptionMessage('Argument 1 passed to MewesK\TwigSpreadsheetBundle\Wrapper\PhpSpreadsheetWrapper::startCell() must be of the type integer'); + $this->expectException(TypeError::class); + $this->expectExceptionMessage('Argument 1 passed to Erelke\TwigSpreadsheetBundle\Wrapper\PhpSpreadsheetWrapper::startCell() must be of the type integer'); $this->getDocument('cellIndexError', $format); } @@ -82,14 +86,14 @@ public function testStartCellIndexError($format) /** * @param string $format * - * @throws \Exception + * @throws Exception * * @dataProvider formatProvider */ public function testStartRowIndexError($format) { - $this->expectException(\TypeError::class); - $this->expectExceptionMessage('Argument 1 passed to MewesK\TwigSpreadsheetBundle\Wrapper\PhpSpreadsheetWrapper::startRow() must be of the type integer'); + $this->expectException(TypeError::class); + $this->expectExceptionMessage('Argument 1 passed to Erelke\TwigSpreadsheetBundle\Wrapper\PhpSpreadsheetWrapper::startRow() must be of the type integer'); $this->getDocument('rowIndexError', $format); } @@ -97,14 +101,14 @@ public function testStartRowIndexError($format) /** * @param string $format * - * @throws \Exception + * @throws Exception * * @dataProvider formatProvider */ public function testSheetError($format) { - $this->expectException(\Twig_Error_Syntax::class); - $this->expectExceptionMessage('Node "MewesK\TwigSpreadsheetBundle\Twig\Node\RowNode" is not allowed inside of Node "MewesK\TwigSpreadsheetBundle\Twig\Node\DocumentNode"'); + $this->expectException(Twig_Error_Syntax::class); + $this->expectExceptionMessage('Node "Erelke\TwigSpreadsheetBundle\Twig\Node\RowNode" is not allowed inside of Node "Erelke\TwigSpreadsheetBundle\Twig\Node\DocumentNode"'); $this->getDocument('sheetError', $format); } diff --git a/tests/Twig/CsvOdsXlsXlsxTwigTest.php b/tests/Twig/CsvOdsXlsXlsxTwigTest.php index f6d7047..76915f4 100644 --- a/tests/Twig/CsvOdsXlsXlsxTwigTest.php +++ b/tests/Twig/CsvOdsXlsXlsxTwigTest.php @@ -1,6 +1,8 @@ getDescription(), 'Unexpected value in description'); - // +/- 24h range to allow possible timezone differences (946684800) - static::assertGreaterThanOrEqual(946598400, $properties->getModified(), 'Unexpected value in modified'); - static::assertLessThanOrEqual(946771200, $properties->getModified(), 'Unexpected value in modified'); + + if ($format === 'ods') { + // +/- 60s range + $now = new DateTime(); + $timestamp = $now->getTimestamp(); + static::assertGreaterThanOrEqual($timestamp - 60, $properties->getModified(), 'Unexpected value in modified'); + static::assertLessThanOrEqual($timestamp + 60, $properties->getModified(), 'Unexpected value in modified'); + } else { + // +/- 24h range to allow possible timezone differences (946684800) + static::assertGreaterThanOrEqual(946598400, $properties->getModified(), 'Unexpected value in modified'); + static::assertLessThanOrEqual(946771200, $properties->getModified(), 'Unexpected value in modified'); + } $security = $document->getSecurity(); static::assertNotNull($security, 'Security does not exist'); @@ -317,7 +328,7 @@ public function testDocumentProperties($format) /** * @param string $format * - * @throws \Exception + * @throws Exception * * @dataProvider formatProvider */ @@ -338,7 +349,7 @@ public function testDocumentWhitespace($format) /** * @param string $format * - * @throws \Exception + * @throws Exception * * @dataProvider formatProvider */ @@ -365,7 +376,7 @@ public function testInclude($format) /** * @param string $format * - * @throws \Exception + * @throws Exception * * @dataProvider formatProvider */ @@ -398,7 +409,7 @@ public function testMacro($format) /** * @param string $format * - * @throws \Exception + * @throws Exception * * @dataProvider formatProvider */ @@ -427,7 +438,7 @@ public function testRowIndex($format) /** * @param string $format * - * @throws \Exception + * @throws Exception * * @dataProvider formatProvider */ @@ -445,7 +456,7 @@ public function testSheet($format) /** * @param string $format * - * @throws \Exception + * @throws Exception * * @dataProvider formatProvider */ @@ -486,7 +497,7 @@ public function testSheetComplex($format) * * @param string $format * - * @throws \Exception + * @throws Exception * * @dataProvider formatProvider */ diff --git a/tests/Twig/PdfTwigTest.php b/tests/Twig/PdfTwigTest.php index 1955ac3..79b38a1 100644 --- a/tests/Twig/PdfTwigTest.php +++ b/tests/Twig/PdfTwigTest.php @@ -1,6 +1,8 @@ markTestSkipped('We don\'t use pdf, now...'); + $path = $this->getDocument('cellProperties', $format); static::assertFileExists($path, 'File does not exist'); diff --git a/tests/Twig/XlsXlsxTwigTest.php b/tests/Twig/XlsXlsxTwigTest.php index 7beb075..8221532 100644 --- a/tests/Twig/XlsXlsxTwigTest.php +++ b/tests/Twig/XlsXlsxTwigTest.php @@ -1,7 +1,8 @@ getDocument('cellProperties', $format); $sheet = $document->getSheetByName('Test'); $cell = $sheet->getCell('A1'); + print_r($cell->getValue()); $dataValidation = $cell->getDataValidation(); static::assertTrue($dataValidation->getAllowBlank(), 'Unexpected value in allowBlank'); @@ -56,7 +59,7 @@ public function testCellProperties($format) * * @param string $format * - * @throws \Exception + * @throws Exception * * @dataProvider formatProvider */ @@ -72,7 +75,7 @@ public function testDocumentProperties($format) /** * @param string $format * - * @throws \Exception + * @throws Exception * * @dataProvider formatProvider */ @@ -114,7 +117,7 @@ public function testDocumentTemplate($format) /** * @param string $format * - * @throws \Exception + * @throws Exception * * @dataProvider formatProvider */ @@ -149,7 +152,7 @@ public function testDrawingProperties($format) /** * @param string $format * - * @throws \Exception + * @throws Exception * * @dataProvider formatProvider */ @@ -180,7 +183,7 @@ public function testHeaderFooterComplex($format) /** * @param string $format * - * @throws \Exception + * @throws Exception * * @dataProvider formatProvider */ @@ -220,7 +223,7 @@ public function testHeaderFooterDrawing($format) /** * @param string $format * - * @throws \Exception + * @throws Exception * * @dataProvider formatProvider */ @@ -249,7 +252,7 @@ public function testHeaderFooterProperties($format) /** * @param string $format * - * @throws \Exception + * @throws Exception * * @dataProvider formatProvider */ From d11f30c180ab28bbff2724a437474ff3b8fc3a29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Er=C5=91ss=20Elem=C3=A9r?= Date: Tue, 2 Jul 2019 16:15:38 +0200 Subject: [PATCH 03/17] update changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index de0d92f..897505a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.3 +* Improve test +* Update namespace +* fix deprecations +* Update to phpspreadsheet 1.8.1 + ## 1.1 * Fixed issue #13 'Incorrect cache directory for images' (technetium) From 605cf70d8810c195332f407994871b28144d4559 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Er=C5=91ss=20Elem=C3=A9r?= Date: Tue, 2 Jul 2019 16:24:22 +0200 Subject: [PATCH 04/17] update scrutinizer config --- .scrutinizer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index e45890c..fbd5e91 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -1,7 +1,7 @@ build: environment: php: - version: '7.0' + version: '7.2' tests: override: - From 58ccc5166db908816dca31cd2efe00fdff442e8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Er=C5=91ss=20Elem=C3=A9r?= Date: Wed, 3 Jul 2019 09:44:21 +0200 Subject: [PATCH 05/17] update travis config --- .travis.yml | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6c02786..48c12c0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,24 +6,14 @@ sudo: false matrix: fast_finish: true include: - - php: '7.0' - env: SYMFONY_VERSION='3.2.*' - - php: '7.0' - env: SYMFONY_VERSION='3.3.*' - - php: '7.0' - env: SYMFONY_VERSION='3.4.*' - php: '7.1' env: SYMFONY_VERSION='3.4.*' - php: '7.2' env: SYMFONY_VERSION='3.4.*' - - php: '7.1.3' - env: SYMFONY_VERSION='4.0.*' - - php: '7.2' - env: SYMFONY_VERSION='4.0.*' - - php: '7.1.3' - env: SYMFONY_VERSION='4.1.*' + - php: '7.1' + env: SYMFONY_VERSION='4.3.*' - php: '7.2' - env: SYMFONY_VERSION='4.1.*' + env: SYMFONY_VERSION='4.3.*' before_install: - if [ "$SYMFONY_VERSION" != "" ]; then composer require --dev --no-update symfony/symfony=$SYMFONY_VERSION; fi From f31612d0b0672fadccc9e249c8491810ced8362a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Er=C5=91ss=20Elem=C3=A9r?= Date: Wed, 3 Jul 2019 11:40:30 +0200 Subject: [PATCH 06/17] update travis config --- .travis.yml | 2 +- src/DependencyInjection/Configuration.php | 10 ++++++++-- tests/Twig/Fixtures/views/cellProperties.twig | 2 +- tests/Twig/XlsxTwigTest.php | 1 - 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 48c12c0..0f56848 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,4 +22,4 @@ install: - composer update $COMPOSER_FLAGS --prefer-dist --prefer-stable script: - - vendor/bin/simple-phpunit + - vendor/bin/simple-phpunit --testdox diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 8cd4a54..ad2ccc7 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -5,6 +5,7 @@ use RuntimeException; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; +use Symfony\Component\HttpKernel\Kernel; /** * Class Configuration. @@ -18,8 +19,13 @@ class Configuration implements ConfigurationInterface */ public function getConfigTreeBuilder() { - $treeBuilder = new TreeBuilder('erelke_twig_spreadsheet'); - $rootNode = $treeBuilder->getRootNode(); + if (version_compare(Kernel::VERSION, '4.3.0', '>=')) { + $treeBuilder = new TreeBuilder('erelke_twig_spreadsheet'); + $rootNode = $treeBuilder->getRootNode(); + } else { + $treeBuilder = new TreeBuilder(); + $rootNode = $treeBuilder->root('erelke_twig_spreadsheet'); + } $rootNode ->children() diff --git a/tests/Twig/Fixtures/views/cellProperties.twig b/tests/Twig/Fixtures/views/cellProperties.twig index f28e9e9..ad65698 100644 --- a/tests/Twig/Fixtures/views/cellProperties.twig +++ b/tests/Twig/Fixtures/views/cellProperties.twig @@ -16,7 +16,7 @@ 'showDropDown': true, 'showErrorMessage': true, 'showInputMessage': true, - 'type': 'custom' + 'type': 'whole' }, 'style': { 'font': { diff --git a/tests/Twig/XlsxTwigTest.php b/tests/Twig/XlsxTwigTest.php index 00a63b2..6130b51 100644 --- a/tests/Twig/XlsxTwigTest.php +++ b/tests/Twig/XlsxTwigTest.php @@ -33,7 +33,6 @@ public function testCellProperties($format) $document = $this->getDocument('cellProperties', $format); $sheet = $document->getSheetByName('Test'); $cell = $sheet->getCell('A1'); - print_r($cell->getValue()); $dataValidation = $cell->getDataValidation(); static::assertTrue($dataValidation->getAllowBlank(), 'Unexpected value in allowBlank'); From 5f116ad280ad47745e87001e32af75bb1a5f6ae3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Er=C5=91ss=20Elem=C3=A9r?= Date: Wed, 3 Jul 2019 11:44:57 +0200 Subject: [PATCH 07/17] update readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 906d77c..fdaddb8 100644 --- a/README.md +++ b/README.md @@ -29,8 +29,8 @@ The following software is required to use PhpSpreadsheet/TwigSpreadsheetBundle. **Required by this bundle:** - * PHP 7.0 or newer - * Symfony 3.2 or newer + * PHP 7.1 or newer + * Symfony 3.4 or newer **Required by PhpSpreadsheet:** From 69e47dca4d696647a711761374f07e796d31661f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Er=C5=91ss=20Elem=C3=A9r?= Date: Fri, 12 Jul 2019 16:15:01 +0200 Subject: [PATCH 08/17] Update to phpspreadsheet 1.8.2 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ba2f229..c2e06b6 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "php": ">=7.1", "symfony/framework-bundle": "~3.4|~4.0", "twig/twig": "~2.0", - "phpoffice/phpspreadsheet": "~1.8.1" + "phpoffice/phpspreadsheet": "1.8.2" }, "require-dev": { "symfony/symfony": "~3.4|~4.0", From 6a7657c6ba85e2582c6ae401f01479f873a62e85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Er=C5=91ss=20Elem=C3=A9r?= Date: Sat, 13 Jul 2019 12:13:07 +0200 Subject: [PATCH 09/17] update phpunit.coverage.xml.dist --- phpunit.coverage.xml.dist | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/phpunit.coverage.xml.dist b/phpunit.coverage.xml.dist index bf095b7..d806436 100644 --- a/phpunit.coverage.xml.dist +++ b/phpunit.coverage.xml.dist @@ -5,6 +5,13 @@ colors="true" bootstrap="./vendor/autoload.php" > + + + + + + + ./tests From dda6f310a942962edfcc2b93e3d5f541b3bdb663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Er=C5=91ss=20Elem=C3=A9r?= Date: Thu, 22 Aug 2019 09:11:27 +0200 Subject: [PATCH 10/17] update to phpspreadsheet 1.9.0 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c2e06b6..f3911b7 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "php": ">=7.1", "symfony/framework-bundle": "~3.4|~4.0", "twig/twig": "~2.0", - "phpoffice/phpspreadsheet": "1.8.2" + "phpoffice/phpspreadsheet": "1.9.0" }, "require-dev": { "symfony/symfony": "~3.4|~4.0", From 7d7a20fc917eea45341cb97affe74bd1e6741e43 Mon Sep 17 00:00:00 2001 From: Gerben Date: Wed, 13 Jan 2021 11:28:44 +0100 Subject: [PATCH 11/17] Updated phpspreadsheet for CVE-2020-7776 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index f3911b7..2587b49 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "php": ">=7.1", "symfony/framework-bundle": "~3.4|~4.0", "twig/twig": "~2.0", - "phpoffice/phpspreadsheet": "1.9.0" + "phpoffice/phpspreadsheet": "1.10.0" }, "require-dev": { "symfony/symfony": "~3.4|~4.0", From 1624282519bb0cd57f41bb5e11061362e513dd06 Mon Sep 17 00:00:00 2001 From: Gerben Date: Wed, 13 Jan 2021 11:54:27 +0100 Subject: [PATCH 12/17] Update composer.json --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 2587b49..a01cd04 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "erelke/twig-spreadsheet-bundle", + "name": "gerben/twig-spreadsheet-bundle", "type": "symfony-bundle", "description": "This Symfony bundle integrates PhpSpreadsheet into Symfony using Twig.", "keywords": ["excel","phpexcel","spreadsheet","phpspreadsheet","twig","symfony"], @@ -7,8 +7,8 @@ "license": "MIT", "authors": [ { - "name": "Elemér Erőss", - "email": "eross@korona.info.hu" + "name": "Gerben Bol", + "email": "contact@gerbenbol.com" }, { "name": "Community Contributors", From a9ec5c07af8fefe64b2a5b1c6f68beb5ea9f4aa4 Mon Sep 17 00:00:00 2001 From: Gerben Date: Wed, 13 Jan 2021 12:03:30 +0100 Subject: [PATCH 13/17] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a01cd04..8aca636 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "gerben/twig-spreadsheet-bundle", + "name": "erelke/twig-spreadsheet-bundle", "type": "symfony-bundle", "description": "This Symfony bundle integrates PhpSpreadsheet into Symfony using Twig.", "keywords": ["excel","phpexcel","spreadsheet","phpspreadsheet","twig","symfony"], From f822df3d8e3f74b431ed39e7f768c7102285b64d Mon Sep 17 00:00:00 2001 From: Gerben Date: Wed, 13 Jan 2021 12:09:49 +0100 Subject: [PATCH 14/17] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 8aca636..a01cd04 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "erelke/twig-spreadsheet-bundle", + "name": "gerben/twig-spreadsheet-bundle", "type": "symfony-bundle", "description": "This Symfony bundle integrates PhpSpreadsheet into Symfony using Twig.", "keywords": ["excel","phpexcel","spreadsheet","phpspreadsheet","twig","symfony"], From 8f3ca7ea93ea4bb8c1aa2054e1b49eedfdfa1bd6 Mon Sep 17 00:00:00 2001 From: Gerben Date: Wed, 13 Jan 2021 12:19:06 +0100 Subject: [PATCH 15/17] Update README.md --- README.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index fdaddb8..6a026dc 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,5 @@ # TwigSpreadsheetBundle -[![Teavis CI: Build Status](https://travis-ci.org/erelke/TwigSpreadsheetBundle.png?branch=master)](https://travis-ci.org/erelke/TwigSpreadsheetBundle) -[![Scrutinizer: Code Quality](https://scrutinizer-ci.com/g/erelke/TwigSpreadsheetBundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/erelke/TwigSpreadsheetBundle/?branch=master) -[![Code Coverage](https://scrutinizer-ci.com/g/erelke/TwigSpreadsheetBundle/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/erelke/TwigSpreadsheetBundle/?branch=master) -[![SensioLabsInsight: Code Quality](https://insight.sensiolabs.com/projects/6f1d5477-967f-4754-bb95-505b1a50b71c/mini.png)](https://insight.sensiolabs.com/projects/6f1d5477-967f-4754-bb95-505b1a50b71c) - This Symfony bundle integrates PhpSpreadsheet into Symfony using Twig. ## Features @@ -43,7 +38,7 @@ The following software is required to use PhpSpreadsheet/TwigSpreadsheetBundle. The source of the documentation is stored in the Resources/doc/ folder in this bundle: -[Resources/doc/index.rst](https://github.com/erelke/TwigSpreadsheetBundle/blob/master/src/Resources/doc/index.rst) +[Resources/doc/index.rst](https://github.com/Gerben321/TwigSpreadsheetBundle/blob/master/src/Resources/doc/index.rst) You can find a prettier version on [readthedocs.org](httsp://readthedocs.org): @@ -57,4 +52,4 @@ All the installation instructions are located in the documentation. This bundle is under the MIT license. See the complete license in the bundle: -[Resources/meta/LICENSE](https://github.com/erelke/TwigSpreadsheetBundle/blob/master/LICENSE) +[Resources/meta/LICENSE](https://github.com/Gerben321/TwigSpreadsheetBundle/blob/master/LICENSE) From bf003c10aa40973ae72debfd7f69adad1d2b76fe Mon Sep 17 00:00:00 2001 From: Gerben Date: Wed, 13 Jan 2021 12:20:41 +0100 Subject: [PATCH 16/17] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a01cd04..ae5a16a 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ }, { "name": "Community Contributors", - "homepage": "https://github.com/erelke/TwigSpreadsheetBundle/graphs/contributors" + "homepage": "https://github.com/Gerben321/TwigSpreadsheetBundle/graphs/contributors" } ], "require": { From 543129899cd4b8c8fb6953fc39d4e2fa7da59e6d Mon Sep 17 00:00:00 2001 From: Gerben Bol Date: Thu, 14 Jan 2021 10:40:41 +0100 Subject: [PATCH 17/17] Revert "Update composer.json" This reverts commit 1624282519bb0cd57f41bb5e11061362e513dd06. --- README.md | 9 +++++++-- composer.json | 8 ++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6a026dc..fdaddb8 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ # TwigSpreadsheetBundle +[![Teavis CI: Build Status](https://travis-ci.org/erelke/TwigSpreadsheetBundle.png?branch=master)](https://travis-ci.org/erelke/TwigSpreadsheetBundle) +[![Scrutinizer: Code Quality](https://scrutinizer-ci.com/g/erelke/TwigSpreadsheetBundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/erelke/TwigSpreadsheetBundle/?branch=master) +[![Code Coverage](https://scrutinizer-ci.com/g/erelke/TwigSpreadsheetBundle/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/erelke/TwigSpreadsheetBundle/?branch=master) +[![SensioLabsInsight: Code Quality](https://insight.sensiolabs.com/projects/6f1d5477-967f-4754-bb95-505b1a50b71c/mini.png)](https://insight.sensiolabs.com/projects/6f1d5477-967f-4754-bb95-505b1a50b71c) + This Symfony bundle integrates PhpSpreadsheet into Symfony using Twig. ## Features @@ -38,7 +43,7 @@ The following software is required to use PhpSpreadsheet/TwigSpreadsheetBundle. The source of the documentation is stored in the Resources/doc/ folder in this bundle: -[Resources/doc/index.rst](https://github.com/Gerben321/TwigSpreadsheetBundle/blob/master/src/Resources/doc/index.rst) +[Resources/doc/index.rst](https://github.com/erelke/TwigSpreadsheetBundle/blob/master/src/Resources/doc/index.rst) You can find a prettier version on [readthedocs.org](httsp://readthedocs.org): @@ -52,4 +57,4 @@ All the installation instructions are located in the documentation. This bundle is under the MIT license. See the complete license in the bundle: -[Resources/meta/LICENSE](https://github.com/Gerben321/TwigSpreadsheetBundle/blob/master/LICENSE) +[Resources/meta/LICENSE](https://github.com/erelke/TwigSpreadsheetBundle/blob/master/LICENSE) diff --git a/composer.json b/composer.json index ae5a16a..2587b49 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "gerben/twig-spreadsheet-bundle", + "name": "erelke/twig-spreadsheet-bundle", "type": "symfony-bundle", "description": "This Symfony bundle integrates PhpSpreadsheet into Symfony using Twig.", "keywords": ["excel","phpexcel","spreadsheet","phpspreadsheet","twig","symfony"], @@ -7,12 +7,12 @@ "license": "MIT", "authors": [ { - "name": "Gerben Bol", - "email": "contact@gerbenbol.com" + "name": "Elemér Erőss", + "email": "eross@korona.info.hu" }, { "name": "Community Contributors", - "homepage": "https://github.com/Gerben321/TwigSpreadsheetBundle/graphs/contributors" + "homepage": "https://github.com/erelke/TwigSpreadsheetBundle/graphs/contributors" } ], "require": {