Restore PDOStatement::quote() for backward compatibility#4287
Restore PDOStatement::quote() for backward compatibility#4287greg0ire merged 1 commit intodoctrine:2.11.xfrom
Conversation
8d548fe to
8557a32
Compare
greg0ire
left a comment
There was a problem hiding this comment.
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. |
SenseException
left a comment
There was a problem hiding this comment.
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.