doctrine/dbal

`Connection::connect` triggers deprecation when `connect` is called from protected scope

javaDeveloperKid opened this issue · 2 comments

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.

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.

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.