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

Connection::connect triggers deprecation when connect is called from protected scope #6442

Open
javaDeveloperKid opened this issue Jun 15, 2024 · 2 comments

Comments

@javaDeveloperKid
Copy link

Bug Report

Q A
Version 3.8

Summary

Class Connection is not final and method connect() is public in 3.8 and protected in 4.0.
I extend Connection class and call parent::connect(). This will still be a valid call in 4.0.
Right now I have my logs flooded with the message User Deprecated: Public access to Connection::connect() is deprecated..

Current behaviour

How to reproduce

Expected behaviour

Do not trigger deprecation when called from protected scope.

@derrabus
Copy link
Member

I would recommend to switch to a driver middleware instead of overriding that connect() method. However you are right, the deprecation should not be triggered in your case. Please send a PR that fixes the issue.

@javaDeveloperKid
Copy link
Author

Actually it's the external package that is extending Connection class (https://github.com/facile-it/doctrine-mysql-come-back) but I will get familiar with this driver middleware functionality because I've never heard about it and will see if this aproach could be used in this package.

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

No branches or pull requests

2 participants