mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
EntityManager calls Connection::getEventManager() which is deprecated since doctrine/dbal:3.5.0 #7064
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @W0rma on GitHub (Oct 24, 2022).
Bug Report
Summary
I noticed the following deprecation warning after upgrading to
doctrine/dbal:3.5.0:Doctrine\DBAL\Connection::getEventManager is deprecated. (Connection.php:273 called by EntityManager.php:1001, https://github.com/doctrine/dbal/issues/5784, package doctrine/dbal)@derrabus commented on GitHub (Oct 24, 2022):
We have addressed this deprecation in 2.14 already, but we won't get rid of that call entirely before 3.0, I'm afraid.
@greg0ire commented on GitHub (Oct 24, 2022):
Have we? I didn't do that in https://github.com/doctrine/orm/pull/10153
@derrabus commented on GitHub (Oct 24, 2022):
Yes, in #9961.
@ruudk commented on GitHub (Jun 2, 2023):
Would it be possible to somehow silence the deprecation as there is no way to solve it for end users?
@greg0ire commented on GitHub (Jun 2, 2023):
Hiding indirect deprecation is the concern of
symfony/phpunit-bridge, isn't it?@ruudk commented on GitHub (Jun 2, 2023):
Sure, but now the Doctrine organization shows deprecations for their own packages. It would be great if a deprecation in dbal would not be triggered if it originated from orm in cases were there is no solution other than major bump. Especially as end users cannot do anything about it.
We run our tests with phpunit-bridge and show all deprecations, including indirect, so that we can report (and sometimes fix) these problems in our dependencies. It's a pitty to see some deprecations for months, because there is no solution.
@greg0ire commented on GitHub (Jun 2, 2023):
No, the PHPUnit bridge/ the Symfony framework bundle do that. We don't show anything. But to answer your question, you as an end user can silence specific deprecations: https://github.com/doctrine/deprecations/#suppressing-specific-deprecations
Maybe that's something you would want to report to
doctrine/deprecations?@derrabus commented on GitHub (Jun 2, 2023):
I'm on a phone right now and cannot investigate further atm. If you're getting this deprecation in a Symfony app, DoctrineBundle would be the place to fix it.
@greg0ire commented on GitHub (Jun 2, 2023):
@ruudk I think you might want to try to use
SYMFONY_DEPRECATIONS_HELPER=/getEventManager/vendor/bin/phpunit` to get a full stack trace (I'm not sure if that will work properly, but you can try). It will help confirm that it comes indeed from the bundle. Also see: https://github.com/doctrine/DoctrineBundle/issues/1665#issuecomment-1570978881@dmaicher commented on GitHub (Jun 2, 2023):
Will be fixed on DoctrineBundle soon. See https://github.com/doctrine/DoctrineBundle/pull/1667