Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	composer.json
#	tests/Functional/BaseFunctionalTest.php
#	tests/Twig/CsvOdsXlsXlsxErrorTwigTest.php
  • Loading branch information
erelke committed Apr 10, 2021
2 parents 8d466a9 + 9244d51 commit 3b3ff53
Show file tree
Hide file tree
Showing 63 changed files with 646 additions and 478 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
/composer.lock
/phpunit.coverage.xml
/phpunit.xml
/.idea
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
build:
environment:
php:
version: '7.0'
version: '7.2'
tests:
override:
-
Expand Down
18 changes: 4 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -32,4 +22,4 @@ install:
- composer update $COMPOSER_FLAGS --prefer-dist --prefer-stable

script:
- vendor/bin/simple-phpunit
- vendor/bin/simple-phpunit --testdox
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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:**

Expand All @@ -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):

Expand All @@ -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)
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,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/" }
}
}
9 changes: 8 additions & 1 deletion phpunit.coverage.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@
colors="true"
bootstrap="./vendor/autoload.php"
>
<php>
<ini name="error_reporting" value="-1" />
<server name="KERNEL_CLASS" value="AppKernel" />
<env name="SYMFONY_PHPUNIT_VERSION" value="7.5.3"/>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="disabled" />
</php>

<testsuites>
<testsuite name="MewesKTwigSpreadsheetBundle Test Suite">
<testsuite name="ErelkeTwigSpreadsheetBundle Test Suite">
<directory>./tests</directory>
</testsuite>
</testsuites>
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</php>

<testsuites>
<testsuite name="MewesKTwigSpreadsheetBundle Test Suite">
<testsuite name="ErelkeTwigSpreadsheetBundle Test Suite">
<directory>./tests</directory>
</testsuite>
</testsuites>
Expand Down
15 changes: 11 additions & 4 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?php

namespace MewesK\TwigSpreadsheetBundle\DependencyInjection;
namespace Erelke\TwigSpreadsheetBundle\DependencyInjection;

use RuntimeException;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
use Symfony\Component\HttpKernel\Kernel;

/**
* Class Configuration.
Expand All @@ -13,12 +15,17 @@ class Configuration implements ConfigurationInterface
/**
* {@inheritdoc}
*
* @throws \RuntimeException
* @throws RuntimeException
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('mewes_k_twig_spreadsheet');
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()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
<?php

namespace MewesK\TwigSpreadsheetBundle\DependencyInjection;
namespace Erelke\TwigSpreadsheetBundle\DependencyInjection;

use Exception;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\HttpKernel\DependencyInjection\ConfigurableExtension;

/**
* Class MewesKTwigSpreadsheetExtension.
* Class ErelkeTwigSpreadsheetExtension.
*/
class MewesKTwigSpreadsheetExtension extends ConfigurableExtension
class ErelkeTwigSpreadsheetExtension extends ConfigurableExtension
{
/**
* {@inheritdoc}
*
* @throws \Exception
* @throws Exception
*/
protected function loadInternal(array $mergedConfig, ContainerBuilder $container)
{
$loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->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);
}
}
12 changes: 12 additions & 0 deletions src/ErelkeTwigSpreadsheetBundle.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace Erelke\TwigSpreadsheetBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

/**
* Class ErelkeTwigSpreadsheetBundle.
*/
class ErelkeTwigSpreadsheetBundle extends Bundle
{
}
2 changes: 1 addition & 1 deletion src/EventListener/AddRequestFormatsListener.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace MewesK\TwigSpreadsheetBundle\EventListener;
namespace Erelke\TwigSpreadsheetBundle\EventListener;

use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
Expand Down
6 changes: 4 additions & 2 deletions src/Helper/Arrays.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

namespace MewesK\TwigSpreadsheetBundle\Helper;
namespace Erelke\TwigSpreadsheetBundle\Helper;

use function is_array;

/**
* Class Arrays.
Expand All @@ -19,7 +21,7 @@ class Arrays
public static function mergeRecursive(array &$array1, array &$array2): array
{
foreach ($array2 as $key => &$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;
}
Expand Down
9 changes: 5 additions & 4 deletions src/Helper/Filesystem.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php

namespace MewesK\TwigSpreadsheetBundle\Helper;
namespace Erelke\TwigSpreadsheetBundle\Helper;

use Symfony\Component\Filesystem\Exception\IOException;
use Symfony\Component\Filesystem\Filesystem as BaseFilesystem;
use Traversable;

/**
* Class Filesystem.
Expand All @@ -18,7 +19,7 @@ class Filesystem
/**
* Creates a directory recursively.
*
* @param string|array|\Traversable $dirs The directory path
* @param string|array|Traversable $dirs The directory path
* @param int $mode The directory mode
*
* @throws IOException On any directory creation failure
Expand All @@ -31,7 +32,7 @@ public static function mkdir($dirs, int $mode = 0777)
/**
* Checks the existence of files or directories.
*
* @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to check
* @param string|array|Traversable $files A filename, an array of files, or a Traversable instance to check
*
* @return bool true if the file exists, false otherwise
*/
Expand All @@ -43,7 +44,7 @@ public static function exists($files): bool
/**
* Removes files or directories.
*
* @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to remove
* @param string|array|Traversable $files A filename, an array of files, or a \Traversable instance to remove
*
* @throws IOException When removal fails
*/
Expand Down
12 changes: 0 additions & 12 deletions src/MewesKTwigSpreadsheetBundle.php

This file was deleted.

8 changes: 4 additions & 4 deletions src/Resources/config/services.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
services:
mewes_k_twig_spreadsheet.add_request_formats_listener:
class: MewesK\TwigSpreadsheetBundle\EventListener\AddRequestFormatsListener
erelke_twig_spreadsheet.add_request_formats_listener:
class: Erelke\TwigSpreadsheetBundle\EventListener\AddRequestFormatsListener
tags:
- { name: kernel.event_subscriber }

mewes_k_twig_spreadsheet.twig_spreadsheet_extension:
class: MewesK\TwigSpreadsheetBundle\Twig\TwigSpreadsheetExtension
erelke_twig_spreadsheet.twig_spreadsheet_extension:
class: Erelke\TwigSpreadsheetBundle\Twig\TwigSpreadsheetExtension
public: true
arguments: [ null ] # config placeholder
tags:
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
source_suffix = '.rst'
master_doc = 'index'
project = 'TwigSpreadsheetBundle'
copyright = u'2018, Mewes Kochheim'
copyright = u'2018-2019, Mewes Kochheim, Erőss Elemér'
version = ''
release = ''
html_theme = 'default'
4 changes: 2 additions & 2 deletions src/Resources/doc/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Configuration

.. code-block:: yaml
# Default configuration for "MewesKTwigSpreadsheetBundle"
mewes_k_twig_spreadsheet:
# Default configuration for "ErelkeTwigSpreadsheetBundle"
erelke_twig_spreadsheet:
# Disabling formula calculations can improve the performance but the resulting documents
# won't immediately show formula results in external programs.
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/doc/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ More examples

For more advanced examples check the unit test scenarios here:

https://github.com/MewesK/TwigSpreadsheetBundle/tree/master/tests/Twig/Fixtures/views
https://github.com/Erelke/TwigSpreadsheetBundle/tree/master/tests/Twig/Fixtures/views
4 changes: 2 additions & 2 deletions src/Resources/doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ following command to download the latest stable version of this bundle:

.. code-block:: terminal
$ composer require mewesk/twig-spreadsheet-bundle
$ composer require erelke/twig-spreadsheet-bundle
This command requires you to have Composer installed globally, as explained
in the `installation chapter`_ of the Composer documentation.
Expand All @@ -30,7 +30,7 @@ Step 2: Enable the Bundle
$bundles = array(
// ...
new MewesK\TwigSpreadsheetBundle\MewesKTwigSpreadsheetBundle(),
new Erelke\TwigSpreadsheetBundle\ErelkeTwigSpreadsheetBundle(),
);
// ...
Expand Down
12 changes: 7 additions & 5 deletions src/Twig/Node/AlignmentNode.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php

namespace MewesK\TwigSpreadsheetBundle\Twig\Node;
namespace Erelke\TwigSpreadsheetBundle\Twig\Node;

use MewesK\TwigSpreadsheetBundle\Wrapper\HeaderFooterWrapper;
use Erelke\TwigSpreadsheetBundle\Wrapper\HeaderFooterWrapper;
use InvalidArgumentException;
use Twig\Compiler as Twig_Compiler;

/**
* Class AlignmentNode.
Expand All @@ -23,7 +25,7 @@ class AlignmentNode extends BaseNode
* @param string|null $tag
* @param string $alignment
*
* @throws \InvalidArgumentException
* @throws InvalidArgumentException
*/
public function __construct(array $nodes = [], array $attributes = [], int $lineNo = 0, string $tag = null, string $alignment = HeaderFooterWrapper::ALIGNMENT_CENTER)
{
Expand All @@ -33,9 +35,9 @@ public function __construct(array $nodes = [], array $attributes = [], int $line
}

/**
* @param \Twig_Compiler $compiler
* @param Twig_Compiler $compiler
*/
public function compile(\Twig_Compiler $compiler)
public function compile(Twig_Compiler $compiler)
{
$compiler->addDebugInfo($this)
->write(self::CODE_FIX_CONTEXT)
Expand Down
Loading

0 comments on commit 3b3ff53

Please sign in to comment.