magento-hackathon / composer-command-integrator

module to create binaries and scripts which get executed in context of composer so they are able to access content from the composer.json
10 stars 12 forks source link

Symfony\Component\Console\Helper\DialogHelper is deprecated and cause Uncaught exception #8

Open kesonno opened 9 years ago

kesonno commented 9 years ago

Calling the ./vendor/bin/composerCommandIntegrator.php fail with the following output:

PHP Deprecated:  "Symfony\Component\Console\Helper\DialogHelper" is deprecated since version 2.5 and will be removed in 3.0. Use "Symfony\Component\Console\Helper\QuestionHelper" instead. in /private/var/www/eurofides/vendor/symfony/console/Symfony/Component/Console/Helper/DialogHelper.php on line 34
PHP Deprecated:  "Symfony\Component\Console\Helper\ProgressHelper" is deprecated since version 2.5 and will be removed in 3.0. Use "Symfony\Component\Console\Helper\ProgressBar" instead. in /private/var/www/eurofides/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressHelper.php on line 123
PHP Fatal error:  Uncaught exception 'ErrorException' with message '"Symfony\Component\Console\Helper\DialogHelper" is deprecated since version 2.5 and will be removed in 3.0. Use "Symfony\Component\Console\Helper\QuestionHelper" instead.' in /private/var/www/eurofides/vendor/symfony/console/Symfony/Component/Console/Helper/DialogHelper.php:34
Stack trace:
#0 [internal function]: Composer\Util\ErrorHandler::handle(16384, '"Symfony\\Compon...', '/private/var/ww...', 34, Array)
#1 /private/var/www/eurofides/vendor/symfony/console/Symfony/Component/Console/Helper/DialogHelper.php(34): trigger_error('"Symfony\\Compon...', 16384)
#2 /private/var/www/eurofides/vendor/composer/composer/src/Composer/Console/Application.php(327): Symfony\Component\Console\Helper\DialogHelper->__construct()
#3 /private/var/www/eurofides/vendor/symfony/console/Symfony/Component/Console/Application.php(88): Composer\Console\Application->getDefaultHelperSet()
#4 /private/var/www/eurofides/vendor/composer/composer/src/Composer/Console/Application.php(69): S in /private/var/www/eurofides/vendor/symfony/console/Symfony/Component/Console/Helper/DialogHelper.php on line 34

Unfortunately turning off E_USER_DEPRECATED in error_reporting is not enought, because Composer\Util\ErrorHandler::handle throw anyway an exception.

TimVroom commented 9 years ago

Well this is a bug from Composer itself.

If i look at the composer/composer/src/Composer/Console/Application.php(327) line, it says:

$helperSet->set(new DialogHelper());

Changing this to:

$helperSet->set(new DialogHelper(false));

Solves the problem for me. Bit weird though, but yeah... If we take a look in the getDefaultHelperSet they use the same method and already define the dialoghelper, so i suppose we can remove the whole line 327...

Flyingmana commented 9 years ago

I will refine the composer.json to avoid installing a newer version of the console package, as long as composer uses the older version. But this needs some time, there seems to be another bug for version resolution

Flyingmana commented 9 years ago

just tagged version 1.1, in my tests now correctly an older console version is installed, can you verify this?

ghost commented 9 years ago

Hey @Flyingmana I'm still seeing this error in v1.2

Flyingmana commented 9 years ago

now having 1.2.1 with a fix for this problem, does this work now for you all?