diff --git a/UPGRADE.md b/UPGRADE.md index 21ec2e9b98b..802c33b155d 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,5 +1,9 @@ # Upgrade to 3.0 +## BC BREAK: PingableConnection and ServerInfoAwareConnection interfaces now extends Connection + +All implementations of the `PingableConnection` and `ServerInfoAwareConnection` interfaces have to implement the methods defined in the `Connection` interface as well. + ## BC BREAK: VersionAwarePlatformDriver interface now extends Driver All implementations of the `VersionAwarePlatformDriver` interface have to implement the methods defined in the `Driver` interface as well. diff --git a/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Connection.php b/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Connection.php index 3439e1b96e5..4960dc13b72 100644 --- a/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Connection.php +++ b/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Connection.php @@ -4,7 +4,6 @@ namespace Doctrine\DBAL\Driver\IBMDB2; -use Doctrine\DBAL\Driver\Connection; use Doctrine\DBAL\Driver\ResultStatement; use Doctrine\DBAL\Driver\ServerInfoAwareConnection; use Doctrine\DBAL\Driver\Statement as DriverStatement; @@ -23,7 +22,7 @@ use function db2_rollback; use function db2_server_info; -class DB2Connection implements Connection, ServerInfoAwareConnection +class DB2Connection implements ServerInfoAwareConnection { /** @var resource */ private $conn = null; diff --git a/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php b/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php index 2be3121ca82..c00590be8e9 100644 --- a/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php +++ b/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php @@ -4,7 +4,6 @@ namespace Doctrine\DBAL\Driver\Mysqli; -use Doctrine\DBAL\Driver\Connection; use Doctrine\DBAL\Driver\Mysqli\Exception\ConnectionError; use Doctrine\DBAL\Driver\PingableConnection; use Doctrine\DBAL\Driver\ResultStatement; @@ -28,7 +27,7 @@ use function sprintf; use function stripos; -class MysqliConnection implements Connection, PingableConnection, ServerInfoAwareConnection +class MysqliConnection implements PingableConnection, ServerInfoAwareConnection { /** * Name of the option to set connection flags diff --git a/lib/Doctrine/DBAL/Driver/PDOConnection.php b/lib/Doctrine/DBAL/Driver/PDOConnection.php index 77704b77e81..d81594b20bf 100644 --- a/lib/Doctrine/DBAL/Driver/PDOConnection.php +++ b/lib/Doctrine/DBAL/Driver/PDOConnection.php @@ -12,7 +12,7 @@ * * Used by all PDO-based drivers. */ -class PDOConnection implements Connection, ServerInfoAwareConnection +class PDOConnection implements ServerInfoAwareConnection { /** @var PDO */ private $connection; diff --git a/lib/Doctrine/DBAL/Driver/PingableConnection.php b/lib/Doctrine/DBAL/Driver/PingableConnection.php index 9a823dc83e8..2b4d292a6eb 100644 --- a/lib/Doctrine/DBAL/Driver/PingableConnection.php +++ b/lib/Doctrine/DBAL/Driver/PingableConnection.php @@ -7,7 +7,7 @@ /** * An interface for connections which support a "native" ping method. */ -interface PingableConnection +interface PingableConnection extends Connection { /** * Pings the database server to determine if the connection is still diff --git a/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereConnection.php b/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereConnection.php index e815f760bda..4cb8162bed9 100644 --- a/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereConnection.php +++ b/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereConnection.php @@ -4,7 +4,6 @@ namespace Doctrine\DBAL\Driver\SQLAnywhere; -use Doctrine\DBAL\Driver\Connection; use Doctrine\DBAL\Driver\ResultStatement; use Doctrine\DBAL\Driver\ServerInfoAwareConnection; use Doctrine\DBAL\Driver\Statement as DriverStatement; @@ -24,7 +23,7 @@ /** * SAP Sybase SQL Anywhere implementation of the Connection interface. */ -class SQLAnywhereConnection implements Connection, ServerInfoAwareConnection +class SQLAnywhereConnection implements ServerInfoAwareConnection { /** @var resource The SQL Anywhere connection resource. */ private $connection; diff --git a/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvConnection.php b/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvConnection.php index a6b09b02818..b7713592274 100644 --- a/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvConnection.php +++ b/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvConnection.php @@ -4,7 +4,6 @@ namespace Doctrine\DBAL\Driver\SQLSrv; -use Doctrine\DBAL\Driver\Connection; use Doctrine\DBAL\Driver\ResultStatement; use Doctrine\DBAL\Driver\ServerInfoAwareConnection; use Doctrine\DBAL\Driver\Statement as DriverStatement; @@ -21,7 +20,7 @@ /** * SQL Server implementation for the Connection interface. */ -class SQLSrvConnection implements Connection, ServerInfoAwareConnection +class SQLSrvConnection implements ServerInfoAwareConnection { /** @var resource */ protected $conn; diff --git a/lib/Doctrine/DBAL/Driver/ServerInfoAwareConnection.php b/lib/Doctrine/DBAL/Driver/ServerInfoAwareConnection.php index e667dddaf92..c33e9b50c8f 100644 --- a/lib/Doctrine/DBAL/Driver/ServerInfoAwareConnection.php +++ b/lib/Doctrine/DBAL/Driver/ServerInfoAwareConnection.php @@ -7,7 +7,7 @@ /** * Contract for a connection that is able to provide information about the server it is connected to. */ -interface ServerInfoAwareConnection +interface ServerInfoAwareConnection extends Connection { /** * Returns the version number of the database server connected to. diff --git a/tests/Doctrine/Tests/DBAL/ConnectionTest.php b/tests/Doctrine/Tests/DBAL/ConnectionTest.php index d9afa1e6667..8815b8b1473 100644 --- a/tests/Doctrine/Tests/DBAL/ConnectionTest.php +++ b/tests/Doctrine/Tests/DBAL/ConnectionTest.php @@ -676,7 +676,7 @@ public function testPlatformDetectionIsTriggerOnlyOnceOnRetrievingPlatform() : v $driverMock = $this->createMock(VersionAwarePlatformDriver::class); /** @var DriverConnection|ServerInfoAwareConnection|MockObject $driverConnectionMock */ - $driverConnectionMock = $this->createMock([DriverConnection::class, ServerInfoAwareConnection::class]); + $driverConnectionMock = $this->createMock(ServerInfoAwareConnection::class); /** @var AbstractPlatform|MockObject $platformMock */ $platformMock = $this->getMockForAbstractClass(AbstractPlatform::class);