Skip to content

Commit 19120c9

Browse files
committed
[doctrineGH-4114] Add deprecation for ServerInfoAwareConnection::requiresQueryForServerVersion
1 parent 8021e49 commit 19120c9

File tree

6 files changed

+42
-0
lines changed

6 files changed

+42
-0
lines changed

lib/Doctrine/DBAL/Driver/IBMDB2/DB2Connection.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Doctrine\DBAL\Driver\IBMDB2\Exception\PrepareFailed;
99
use Doctrine\DBAL\Driver\ServerInfoAwareConnection;
1010
use Doctrine\DBAL\ParameterType;
11+
use Doctrine\Deprecations\Deprecation;
1112
use stdClass;
1213

1314
use function assert;
@@ -82,6 +83,12 @@ public function getServerVersion()
8283
*/
8384
public function requiresQueryForServerVersion()
8485
{
86+
Deprecation::triggerIfCalledFromOutside(
87+
'doctrine/dbal',
88+
'https://github.com/doctrine/dbal/pull/4114',
89+
'ServerInfoAwareConnection::requiresQueryForServerVersion() is deprecated and removed in DBAL 3.'
90+
);
91+
8592
return false;
8693
}
8794

lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Doctrine\DBAL\Driver\PingableConnection;
1010
use Doctrine\DBAL\Driver\ServerInfoAwareConnection;
1111
use Doctrine\DBAL\ParameterType;
12+
use Doctrine\Deprecations\Deprecation;
1213
use mysqli;
1314

1415
use function assert;
@@ -135,6 +136,12 @@ public function getServerVersion()
135136
*/
136137
public function requiresQueryForServerVersion()
137138
{
139+
Deprecation::triggerIfCalledFromOutside(
140+
'doctrine/dbal',
141+
'https://github.com/doctrine/dbal/pull/4114',
142+
'ServerInfoAwareConnection::requiresQueryForServerVersion() is deprecated and removed in DBAL 3.'
143+
);
144+
138145
return false;
139146
}
140147

lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Doctrine\DBAL\Driver\OCI8\Exception\SequenceDoesNotExist;
77
use Doctrine\DBAL\Driver\ServerInfoAwareConnection;
88
use Doctrine\DBAL\ParameterType;
9+
use Doctrine\Deprecations\Deprecation;
910
use UnexpectedValueException;
1011

1112
use function addcslashes;
@@ -103,6 +104,12 @@ public function getServerVersion()
103104
*/
104105
public function requiresQueryForServerVersion()
105106
{
107+
Deprecation::triggerIfCalledFromOutside(
108+
'doctrine/dbal',
109+
'https://github.com/doctrine/dbal/pull/4114',
110+
'ServerInfoAwareConnection::requiresQueryForServerVersion() is deprecated and removed in DBAL 3.'
111+
);
112+
106113
return false;
107114
}
108115

lib/Doctrine/DBAL/Driver/PDOConnection.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Doctrine\DBAL\Driver\PDO\Exception;
77
use Doctrine\DBAL\Driver\PDO\Statement;
88
use Doctrine\DBAL\ParameterType;
9+
use Doctrine\Deprecations\Deprecation;
910
use PDO;
1011
use PDOException;
1112
use PDOStatement;
@@ -113,6 +114,12 @@ public function lastInsertId($name = null)
113114
*/
114115
public function requiresQueryForServerVersion()
115116
{
117+
Deprecation::triggerIfCalledFromOutside(
118+
'doctrine/dbal',
119+
'https://github.com/doctrine/dbal/pull/4114',
120+
'ServerInfoAwareConnection::requiresQueryForServerVersion() is deprecated and removed in DBAL 3.'
121+
);
122+
116123
return false;
117124
}
118125

lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereConnection.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Doctrine\DBAL\Driver\Result;
77
use Doctrine\DBAL\Driver\ServerInfoAwareConnection;
88
use Doctrine\DBAL\ParameterType;
9+
use Doctrine\Deprecations\Deprecation;
910

1011
use function assert;
1112
use function func_get_args;
@@ -198,6 +199,12 @@ public function quote($value, $type = ParameterType::STRING)
198199
*/
199200
public function requiresQueryForServerVersion()
200201
{
202+
Deprecation::triggerIfCalledFromOutside(
203+
'doctrine/dbal',
204+
'https://github.com/doctrine/dbal/pull/4114',
205+
'ServerInfoAwareConnection::requiresQueryForServerVersion() is deprecated and removed in DBAL 3.'
206+
);
207+
201208
return true;
202209
}
203210

lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvConnection.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Doctrine\DBAL\Driver\ServerInfoAwareConnection;
88
use Doctrine\DBAL\Driver\SQLSrv\Exception\Error;
99
use Doctrine\DBAL\ParameterType;
10+
use Doctrine\Deprecations\Deprecation;
1011

1112
use function func_get_args;
1213
use function is_float;
@@ -77,6 +78,12 @@ public function getServerVersion()
7778
*/
7879
public function requiresQueryForServerVersion()
7980
{
81+
Deprecation::triggerIfCalledFromOutside(
82+
'doctrine/dbal',
83+
'https://github.com/doctrine/dbal/pull/4114',
84+
'ServerInfoAwareConnection::requiresQueryForServerVersion() is deprecated and removed in DBAL 3.'
85+
);
86+
8087
return false;
8188
}
8289

0 commit comments

Comments
 (0)