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

Recommended usage triggers deprecation errors #14

Closed
bds-viktoras opened this issue Oct 18, 2019 · 8 comments
Closed

Recommended usage triggers deprecation errors #14

bds-viktoras opened this issue Oct 18, 2019 · 8 comments

Comments

@bds-viktoras
Copy link

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
Copy link
Member

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
Copy link
Member

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

@bds-viktoras
Copy link
Author

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:

  • \Kreait\Firebase is deprecated since version 4.33. Obviously all the methods inside of this class are deprecated as well;
  • ProjectFactory::create() calls $factory->create(), which is deprecated as well;

@jeromegamez
Copy link
Member

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
Copy link
Member

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
Copy link
Author

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
Copy link
Member

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
Copy link
Contributor

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.

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