diff --git a/lib/Doctrine/DBAL/Driver/PDOConnection.php b/lib/Doctrine/DBAL/Driver/PDOConnection.php index 43b8280ef70..7553ca58df5 100644 --- a/lib/Doctrine/DBAL/Driver/PDOConnection.php +++ b/lib/Doctrine/DBAL/Driver/PDOConnection.php @@ -5,6 +5,7 @@ use Doctrine\DBAL\Driver\Connection as ConnectionInterface; use Doctrine\DBAL\Driver\PDO\Exception; use Doctrine\DBAL\Driver\PDO\Statement; +use Doctrine\DBAL\ParameterType; use PDO; use PDOException; use PDOStatement; @@ -101,6 +102,14 @@ public function query() } } + /** + * {@inheritdoc} + */ + public function quote($input, $type = ParameterType::STRING) + { + return parent::quote($input, $type); + } + /** * {@inheritdoc} */ diff --git a/phpcs.xml.dist b/phpcs.xml.dist index c82ca439eca..8c6b82da6b0 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -110,6 +110,11 @@ lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php + + + lib/Doctrine/DBAL/Driver/PDOConnection.php + + lib/Doctrine/DBAL/Driver/ExceptionConverterDriver.php diff --git a/tests/Doctrine/Tests/DBAL/Functional/Driver/PDO/ConnectionTest.php b/tests/Doctrine/Tests/DBAL/Functional/Driver/PDO/ConnectionTest.php index f54cb07b06a..c9f748fbce6 100644 --- a/tests/Doctrine/Tests/DBAL/Functional/Driver/PDO/ConnectionTest.php +++ b/tests/Doctrine/Tests/DBAL/Functional/Driver/PDO/ConnectionTest.php @@ -1,5 +1,7 @@ driverConnection->query('foo'); } + + /** + * This test ensures backward compatibility with DBAL 2.x and should be removed in 3.0. + */ + public function testQuoteInteger(): void + { + self::assertSame("'1'", $this->connection->getWrappedConnection()->quote(1)); + } }