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

Recommended usage triggers deprecation errors #14

Closed bds-viktoras closed 4 years ago

bds-viktoras commented 4 years ago

A sample usage as per readme, for example, $container->get('firebase') triggers deprecations, as the main bundle got a lot of deprecations since version 4.33.

jeromegamez commented 4 years ago

Thank you for bringing this up! Unfortunately, I didn‘t get around creating a new major bundle release in time. I‘ll create a new release of the SDK that removes the deprecation warnings again and let you know once it’s done.

jeromegamez commented 4 years ago

I just released 1.5.0 of the bundle, please let me know if this fixes the issue for you.

bds-viktoras commented 4 years ago

Unfortunately not. The reason is that bundle's usage suggest $this->get('firebase') (aliased version), which instantiates \Kreait\Firebase class through ProjectFactory::create().

The following problems then happen:

jeromegamez commented 4 years ago

Ah, I assumed that removing the „trigger_errors“ calls would be enough... unfortunately the only solution at this point in time would be to fix the SDK version to 4.32.0 in your root composer JSON until I can find the time to update the bundle :/.

An alternative would be to define the services manually in your project (without the bundle)...

Sorry for the inconvenience!

jeromegamez commented 4 years ago

How do you get the deprecation warnings? I'm using the bundle in https://github.com/jeromegamez/firebase-php-examples and I don't get them.

bds-viktoras commented 4 years ago

Sorry, I should have been more specific: I meant "soft deprecations" (IDE and code tools warnings) as opposed to "hard deprecations" (actual errors being triggered).

In any case, right now the dependencies that allows to use this bundle without deprecations are:

       "kreait/firebase-php": "4.32",
       "kreait/firebase-bundle": "1.3",
jeromegamez commented 4 years ago

Ah, now I get it, thanks for clearing it up! I will extend the bundle so that it follows the recommendations of the SDK, but I, unfortunately, don't know yet when I will find the time.

That being said - even if the methods are deprecated, you can still use them (but I know that you know that 😅). As for the code tools, could perhaps https://symfony.com/doc/current/components/phpunit_bridge.html#direct-and-indirect-deprecations help? I'm not super-familiar with that, but I think this could be used to ignore those deprecations.

github-actions[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.