kreait / firebase-bundle

A Symfony Bundle for the Firebase PHP Admin SDK
https://github.com/kreait/firebase-php
MIT License
135 stars 25 forks source link

2.6.0 calls setDeprecated with incorrect parameters for Symfony 4.4 #38

Closed dinfinity closed 2 years ago

dinfinity commented 2 years ago

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

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 commented 2 years ago

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 commented 2 years ago

Thanks for the quick fix!