Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.6.0 calls setDeprecated with incorrect parameters for Symfony 4.4 #38

Closed
dinfinity opened this issue Dec 3, 2021 · 2 comments
Closed

Comments

@dinfinity
Copy link

dinfinity commented Dec 3, 2021

The problem

In a local project I have 2.6.0 installed combined with symfony/symfony 4.4.35. It apparently makes an incorrect call to Alias->setDeprecated() (it takes 2 parameters, but 3 are provided with the template being the last one).

See run of cache:clear below.

Environment

  • PHP Version (php -v): 7.4.22
  • Firebase PHP SDK and Bundle version (composer show | grep kreait):
    kreait/clock 1.1.0 A PHP 7.0 compatible clock abstraction
    kreait/firebase-bundle 2.6.0 Symfony Bundle for the Firebase Admin SDK
    kreait/firebase-php 5.25.0 Firebase Admin SDK
    kreait/firebase-tokens 1.16.1 A library to work with Firebase tokens

Details

vagrant@development:/vagrant$ php7.4 /vagrant/app/console cache:clear --env=dev --no-warmup -vvv

In Alias.php line 107:
                                                                              
  [Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]  
  The deprecation template must contain the "%alias_id%" placeholder.         
                                                                              

Exception trace:
  at /vagrant/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Alias.php:107
 Symfony\Component\DependencyInjection\Alias->setDeprecated() at /vagrant/vendor/kreait/firebase-bundle/src/DependencyInjection/FirebaseExtension.php:87
 Kreait\Firebase\Symfony\Bundle\DependencyInjection\FirebaseExtension->registerService() at /vagrant/vendor/kreait/firebase-bundle/src/DependencyInjection/FirebaseExtension.php:42
 Kreait\Firebase\Symfony\Bundle\DependencyInjection\FirebaseExtension->processProjectConfiguration() at /vagrant/vendor/kreait/firebase-bundle/src/DependencyInjection/FirebaseExtension.php:36
 Kreait\Firebase\Symfony\Bundle\DependencyInjection\FirebaseExtension->load() at /vagrant/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php:76
 Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass->process() at /vagrant/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php:39
 Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass->process() at /vagrant/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php:94
 Symfony\Component\DependencyInjection\Compiler\Compiler->compile() at /vagrant/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:762
 Symfony\Component\DependencyInjection\ContainerBuilder->compile() at /vagrant/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:596
 Symfony\Component\HttpKernel\Kernel->initializeContainer() at /vagrant/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:136
 Symfony\Component\HttpKernel\Kernel->boot() at /vagrant/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:169
 Symfony\Bundle\FrameworkBundle\Console\Application->registerCommands() at /vagrant/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:75
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /vagrant/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:149
 Symfony\Component\Console\Application->run() at /vagrant/app/console:72

Code to reproduce issue

N/A. AFAICS this should happen in all Symfony 4.4 projects.

@jeromegamez
Copy link
Member

When I looked up the deprecation feature, I looked in the Symfony 6.x docs instead of the 4.x docs 🙈, thank you for spotting the mistake early on!

Release 2.6.1 should include the fix - I also added a 2.x branch and tests running on GitHub actions to (hopefully 🤞) avoid mistakes like these in the future.

Thanks again! 🌺

@dinfinity
Copy link
Author

Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants