andres-montanez / Magallanes

The PHP Deployment Tool
https://magephp.com
MIT License
694 stars 167 forks source link

TypeError Exception with Composer 2.3.0 #455

Closed gilbertsoft closed 2 years ago

gilbertsoft commented 2 years ago

When I run this command:

composer global exec mage deploy develop

I get the following output:

Changed current directory to /home/runner/.composer
Error: Composer\EventDispatcher\EventDispatcher::addListener(): Argument #2 ($listener) must be of type callable, string given, called in phar:///usr/local/bin/composer/src/Composer/Command/ExecCommand.php on line 93

In EventDispatcher.php line 403:

  [TypeError]                                                                  
  Composer\EventDispatcher\EventDispatcher::addListener(): Argument #2 ($list  
  ener) must be of type callable, string given, called in phar:///usr/local/b  
  in/composer/src/Composer/Command/ExecCommand.php on line 93                  

Exception trace:
  at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:403
 Composer\EventDispatcher\EventDispatcher->addListener() at phar:///usr/local/bin/composer/src/Composer/Command/ExecCommand.php:93
 Composer\Command\ExecCommand->execute() at phar:///usr/local/bin/composer/vendor/symfony/console/Command/Command.php:298
 Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:1015
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:299
 Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:334
 Composer\Console\Application->doRun() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:130
 Composer\Console\Application->run() at phar:///usr/local/bin/composer/src/Composer/Command/GlobalCommand.php:118
 Composer\Command\GlobalCommand->run() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:1015
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:299
 Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:334
 Composer\Console\Application->doRun() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:130
 Composer\Console\Application->run() at phar:///usr/local/bin/composer/bin/composer:83
 require() at /usr/local/bin/composer:29

exec [-l|--list] [--] [<binary> [<args>...]]

Error: Process completed with exit code 1.

The failed GH workflow can be found here https://github.com/TYPO3/get.typo3.org/runs/5754752804?check_suite_focus=true

andres-montanez commented 2 years ago

Hi, thanks! Looks like a type issue regarding the PHP's version, most likely I'll migrate to PHP 8 with the new version.

gilbertsoft commented 2 years ago

Had no issues with Composer 2.2.9 and PHP 8.1. Also reported the issue to Composer see https://github.com/composer/composer/issues/10672

gilbertsoft commented 2 years ago

@andres-montanez I got feedback from Composer and the issue is already fixed with the current snapshot. I suggest to close this issue with the next Composer release.

Tested with Composer 2.3-dev+f1e3ba74abf39791f0dc9b7e0c6492b40685e1d8 and works again.

https://github.com/TYPO3/get.typo3.org/runs/5758998915?check_suite_focus=true

andres-montanez commented 2 years ago

Allright! Best issue ever :) Thanks @gilbertsoft !!

gilbertsoft commented 2 years ago

It's released https://github.com/composer/composer/releases/tag/2.3.2 so I'm going to close the issue here.