MewesK / TwigExcelBundle

PhpExcel integration for Twig/Symfony
38 stars 22 forks source link

Installation with PHP 7.1 #27

Closed lukepass closed 7 years ago

lukepass commented 7 years ago

Hello, I tired installing this bundle (version 2.2) with PHP 7.1 but I received this error:

$ composer require mewesk/twig-excel-bundle:2.2
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for mewesk/twig-excel-bundle 2.2 -> satisfiable by mewesk/twig-excel-bundle[2.2].
    - mewesk/twig-excel-bundle 2.2 requires php 5.5.9 - 7.0 -> your PHP version (7.1.5) does not satisfy that requirement.

Installation failed, reverting ./composer.json to its original content.

If I use the previous version (2.1), the bundle installs fine but I receive this error:

PHP Fatal error:  Class MewesK\TwigExcelBundle\Twig\TokenParser\XlsBlockTokenParser may not inherit from final class (Twig_TokenParser_Block) in /home/luca/Sites/edra_export/vendor/mewesk/twig-excel-bundle/Twig/TokenParser/XlsBlockTokenParser.php on line 0

  [Symfony\Component\Debug\Exception\FatalErrorException]                                                                                     
  Compile Error: Class MewesK\TwigExcelBundle\Twig\TokenParser\XlsBlockTokenParser may not inherit from final class (Twig_TokenParser_Block)

Thanks, Luca

MewesK commented 7 years ago

Hey Luca,

I hope you don't mind that I quote myself:

PhpExcel only supports PHP 7.0. The next version has moved under its new name PhpSpreadsheet´which is a mayor refactoring using proper namespaces etc. It also comes with PHP 7.1 support. But sadly it's still under development. However it is pretty stable at the moment (according to my unit tests), so I took the chance to do some mayor refactorings on my part as well. The result can be found at TwigSpreadsheetBundle. The mayor BC break is the removal of xlsmacro and xlsinclude. I've finally managed to make the native macro and include tags working. I will release version 1.0 as soon as PhpSpreadsheet decides to be stable :)