amzn / amazon-payments-magento-2-plugin

Extension to enable Amazon Pay on Magento 2
https://amzn.github.io/amazon-payments-magento-2-plugin/
Apache License 2.0
109 stars 77 forks source link

Compilation issue with 5.14.2 and PHP version < 8 #1179

Closed sgabhart22 closed 1 year ago

sgabhart22 commented 1 year ago

What I expected

The module should compile without error.

What happened instead

Syntax error due to trailing comma in the parameter list passed to CheckoutSessionManagement constructor:

`syntax error, unexpected ')', expecting variable (T_VARIABLE)#0 /var/www/html/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile('/var/www/html/v...')

1 [internal function]: Composer\Autoload\ClassLoader->loadClass('Amazon\Pay\Mode...')

2 [internal function]: spl_autoload_call('Amazon\Pay\Mode...')

3 /var/www/html/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(134): class_exists('Amazon\Pay\Mode...')

4 /var/www/html/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(117): Magento\Setup\Module\Di\Code\Reader\ClassesScanner->includeClass('Amazon\Pay\Mode...', '/var/www/html/a...')

5 /var/www/html/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(87): Magento\Setup\Module\Di\Code\Reader\ClassesScanner->extract(Object(RecursiveIteratorIterator))

6 /var/www/html/setup/src/Magento/Setup/Module/Di/App/Task/Operation/RepositoryGenerator.php(61): Magento\Setup\Module\Di\Code\Reader\ClassesScanner->getList('/var/www/html/a...')

7 /var/www/html/setup/src/Magento/Setup/Module/Di/App/Task/Manager.php(56): Magento\Setup\Module\Di\App\Task\Operation\RepositoryGenerator->doOperation()

8 /var/www/html/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php(216): Magento\Setup\Module\Di\App\Task\Manager->process(Object(Closure), Object(Closure))

9 /var/www/html/vendor/symfony/console/Command/Command.php(255): Magento\Setup\Console\Command\DiCompileCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

10 /var/www/html/vendor/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

11 /var/www/html/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(Magento\Setup\Console\Command\DiCompileCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

12 /var/www/html/vendor/magento/framework/Console/Cli.php(115): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

13 /var/www/html/vendor/symfony/console/Application.php(149): Magento\Framework\Console\Cli->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

14 /var/www/html/bin/magento(23): Symfony\Component\Console\Application->run()

15 {main}

`

Steps to reproduce the issue

Your setup

sgabhart22 commented 1 year ago

For anyone running into this issue, the attached patch can be applied to address it until the fix is released in version 5.14.3.

asd-1058.patch.txt

sgabhart22 commented 1 year ago

Closing due to availability of module version 5.14.3 on the Magento Marketplace.