-
-
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
Restore PDOStatement::quote() for backward compatibility #4287
Conversation
8d548fe
to
8557a32
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good
well, int is a valid type according to the API
Is it really? I don't know what phpdoc we inherit but the signature says this should be a string: https://www.php.net/manual/en/pdo.quote.php
Also, it's a bit weird that PHPstan does not complain for this test… maybe it's a new rule, or maybe it's a level above the one we currently use.
It is. This is the phpdoc dbal/lib/Doctrine/DBAL/Driver/Connection.php Lines 31 to 39 in b5e1599
Take this code for example: $conn = DriverManager::getConnection(
'driver' => 'pdo_sqlite',
'dbname' => 'sqlite::memory:',
)->getWrappedConnection(); For the caller, Furthermore, some other drivers explicitly handle the non-string values in dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php Lines 129 to 133 in b5e1599
We don't run PHPStan on tests in 2.x: Lines 3 to 5 in b5e1599
I tried enabling them quite some time ago and gave up because it was close to impossible w/o suppressing hundreds of errors or breaking BC. At that time, it wasn't clear that 2.x would be supported for that much longer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since 2.10.x won't get this fix, this PR looks goot to me.
Thanks for the explanation @morozov , very clear! |
Release [2.11.1](https://github.com/doctrine/dbal/milestone/80) 2.11.1 ====== - Total issues resolved: **2** - Total pull requests resolved: **8** - Total contributors: **6** Documentation ------------- - [4299: Link to contributing guide](doctrine#4299) thanks to @greg0ire SQLite,Test Suite,pdo_sqlite ---------------------------- - [4297: Fix ExceptionTest::testConnectionExceptionSqLite() on macOS](doctrine#4297) thanks to @morozov - [4296: Increase indent in definition lists](doctrine#4296) thanks to @greg0ire Deprecation,Prepared Statements ------------------------------- - [4291: Deprecate Abstraction\Result](doctrine#4291) thanks to @morozov BC Fix,Quoting -------------- - [4287: Restore PDOStatement::quote() for backward compatibility](doctrine#4287) thanks to @morozov and @Shahelm BC Fix,Query ------------ - [4286: Fix BC break: QueryBuilder::andWhere() etc. should ignore empty strings](doctrine#4286) thanks to @BenMorel and @infabo Bug,Documentation,Prepared Statements ------------------------------------- - [4285: Fix phpdoc on deprecated functions](doctrine#4285) thanks to @qdequippe Bug,PDO,Prepared Statements --------------------------- - [4173: Fix Third parameter not allowed for PDO::FETCH&doctrine#95;COLUMN](doctrine#4173) thanks to @BenMorel # gpg: Signature made Sun Sep 27 06:35:40 2020 # gpg: using DSA key 1BEDEE0A820BC30D858F9F0C2C3A645671828132 # gpg: Can't check signature: No public key
Fixes #4281.