From 02a1adf87f17995ff815e4f4c672afeb001dc4ec Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Sun, 31 Dec 2017 19:25:28 -0800 Subject: [PATCH] [BC] Replaced PDO constants with values --- composer.json | 1 - lib/Doctrine/DBAL/Driver/ResultStatement.php | 12 ++++++------ lib/Doctrine/DBAL/Driver/Statement.php | 10 +++++----- lib/Doctrine/DBAL/Portability/Connection.php | 4 ++-- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/composer.json b/composer.json index 33734f05dd0..b7a699d8120 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,6 @@ ], "require": { "php": "^7.1", - "ext-pdo": "*", "doctrine/common": "^2.7.1" }, "require-dev": { diff --git a/lib/Doctrine/DBAL/Driver/ResultStatement.php b/lib/Doctrine/DBAL/Driver/ResultStatement.php index 54f2858e6b1..5e391cf9dbc 100644 --- a/lib/Doctrine/DBAL/Driver/ResultStatement.php +++ b/lib/Doctrine/DBAL/Driver/ResultStatement.php @@ -17,7 +17,7 @@ interface ResultStatement extends \Traversable * * @see \PDO::FETCH_ASSOC */ - const FETCH_ASSOC = \PDO::FETCH_ASSOC; + const FETCH_ASSOC = 2; /** * Specifies that the fetch method shall return each row as an array indexed @@ -26,7 +26,7 @@ interface ResultStatement extends \Traversable * * @see \PDO::FETCH_NUM */ - const FETCH_NUM = \PDO::FETCH_NUM; + const FETCH_NUM = 3; /** * Specifies that the fetch method shall return each row as an array indexed @@ -35,7 +35,7 @@ interface ResultStatement extends \Traversable * * @see \PDO::FETCH_BOTH */ - const FETCH_BOTH = \PDO::FETCH_BOTH; + const FETCH_BOTH = 4; /** * Specifies that the fetch method shall return each row as an object with @@ -44,7 +44,7 @@ interface ResultStatement extends \Traversable * * @see \PDO::FETCH_OBJ */ - const FETCH_OBJ = \PDO::FETCH_OBJ; + const FETCH_OBJ = 5; /** * Specifies that the fetch method shall return only a single requested @@ -52,7 +52,7 @@ interface ResultStatement extends \Traversable * * @see \PDO::FETCH_COLUMN */ - const FETCH_COLUMN = \PDO::FETCH_COLUMN; + const FETCH_COLUMN = 7; /** * Specifies that the fetch method shall return a new instance of the @@ -60,7 +60,7 @@ interface ResultStatement extends \Traversable * * @see \PDO::FETCH_CLASS */ - const FETCH_CLASS = \PDO::FETCH_CLASS; + const FETCH_CLASS = 8; /** * Closes the cursor, enabling the statement to be executed again. diff --git a/lib/Doctrine/DBAL/Driver/Statement.php b/lib/Doctrine/DBAL/Driver/Statement.php index 67e2654df93..1527b478240 100644 --- a/lib/Doctrine/DBAL/Driver/Statement.php +++ b/lib/Doctrine/DBAL/Driver/Statement.php @@ -20,35 +20,35 @@ interface Statement extends ResultStatement * * @see \PDO::PARAM_NULL */ - const PARAM_NULL = \PDO::PARAM_NULL; + const PARAM_NULL = 0; /** * Represents the SQL INTEGER data type. * * @see \PDO::PARAM_INT */ - const PARAM_INT = \PDO::PARAM_INT; + const PARAM_INT = 1; /** * Represents the SQL CHAR, VARCHAR, or other string data type. * * @see \PDO::PARAM_STR */ - const PARAM_STR = \PDO::PARAM_STR; + const PARAM_STR = 2; /** * Represents the SQL large object data type. * * @see \PDO::PARAM_LOB */ - const PARAM_LOB = \PDO::PARAM_LOB; + const PARAM_LOB = 3; /** * Represents a boolean data type. * * @see \PDO::PARAM_BOOL */ - const PARAM_BOOL = \PDO::PARAM_BOOL; + const PARAM_BOOL = 5; /** * Binds a value to a corresponding named (not supported by mysqli driver, see comment below) or positional diff --git a/lib/Doctrine/DBAL/Portability/Connection.php b/lib/Doctrine/DBAL/Portability/Connection.php index a3d49c67145..d339e46e84e 100644 --- a/lib/Doctrine/DBAL/Portability/Connection.php +++ b/lib/Doctrine/DBAL/Portability/Connection.php @@ -18,14 +18,14 @@ class Connection extends \Doctrine\DBAL\Connection * * @see \PDO::CASE_UPPER */ - const CASE_UPPER = \PDO::CASE_UPPER; + const CASE_UPPER = 1; /** * Force column names to lower case. * * @see \PDO::CASE_LOWER */ - const CASE_LOWER = \PDO::CASE_LOWER; + const CASE_LOWER = 2; const PORTABILITY_ALL = 255; const PORTABILITY_NONE = 0;