-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
New assertion breaks QueryBuilder with dummy driver #4250
Comments
Before the assertion was added, there was a contract for implementations though: dbal/lib/Doctrine/DBAL/Connection.php Line 1453 in e48861e
The contract is enforced now, any implementation should already be compliant. You can work this around by disabling assertions, or you could implement the contract by returning a dummy implementation of |
The class itself is already a |
Doesn't having a dummy driver feel silly already? Anyway, I don't think we are going to revert this to humor this use case, sorry. Feels a bit too much like xkcd 1172 |
Doesn't having a QueryBuilder tied to an active connection feel silly? I'm trying to work around these artificial constraints. |
It sure does. Good luck with your issue. |
Closing as per #4094 (comment) |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I use the Doctrine QueryBuilder with a foreign database library. Since the QueryBuilder does not work without a driver, I create a dummy driver so I can just use the QueryBuilder. This worked until a BC break in a minor revision that added an assertion that disagrees with the type hint on the backing field.
BC Break Report
Summary
When upgrading from 2.10.2. to 2.10.3 my code breaks due to this change: e48861e
dbal/lib/Doctrine/DBAL/Connection.php
Line 1459 in e48861e
Previous behaviour
Previously
$this->_conn
was allowed to benull
. The type hint for$_conn
still reads as nullable, but for some reason this assertion was added that disagrees with this.dbal/lib/Doctrine/DBAL/Connection.php
Lines 82 to 87 in e48861e
Current behavior
Since the assertions forces
$_conn
to be non-null, it breaks cases where$_conn
is null.How to reproduce
The text was updated successfully, but these errors were encountered: