PingableConnection and ServerInfoAwareConnection now extend Connection

parent a6af8ffd
# Upgrade to 3.0 # 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 ## 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. All implementations of the `VersionAwarePlatformDriver` interface have to implement the methods defined in the `Driver` interface as well.
......
...@@ -4,7 +4,6 @@ declare(strict_types=0); ...@@ -4,7 +4,6 @@ declare(strict_types=0);
namespace Doctrine\DBAL\Driver\IBMDB2; namespace Doctrine\DBAL\Driver\IBMDB2;
use Doctrine\DBAL\Driver\Connection;
use Doctrine\DBAL\Driver\ResultStatement; use Doctrine\DBAL\Driver\ResultStatement;
use Doctrine\DBAL\Driver\ServerInfoAwareConnection; use Doctrine\DBAL\Driver\ServerInfoAwareConnection;
use Doctrine\DBAL\Driver\Statement as DriverStatement; use Doctrine\DBAL\Driver\Statement as DriverStatement;
...@@ -23,7 +22,7 @@ use function db2_prepare; ...@@ -23,7 +22,7 @@ use function db2_prepare;
use function db2_rollback; use function db2_rollback;
use function db2_server_info; use function db2_server_info;
class DB2Connection implements Connection, ServerInfoAwareConnection class DB2Connection implements ServerInfoAwareConnection
{ {
/** @var resource */ /** @var resource */
private $conn = null; private $conn = null;
......
...@@ -4,7 +4,6 @@ declare(strict_types=1); ...@@ -4,7 +4,6 @@ declare(strict_types=1);
namespace Doctrine\DBAL\Driver\Mysqli; namespace Doctrine\DBAL\Driver\Mysqli;
use Doctrine\DBAL\Driver\Connection;
use Doctrine\DBAL\Driver\Mysqli\Exception\ConnectionError; use Doctrine\DBAL\Driver\Mysqli\Exception\ConnectionError;
use Doctrine\DBAL\Driver\PingableConnection; use Doctrine\DBAL\Driver\PingableConnection;
use Doctrine\DBAL\Driver\ResultStatement; use Doctrine\DBAL\Driver\ResultStatement;
...@@ -28,7 +27,7 @@ use function set_error_handler; ...@@ -28,7 +27,7 @@ use function set_error_handler;
use function sprintf; use function sprintf;
use function stripos; use function stripos;
class MysqliConnection implements Connection, PingableConnection, ServerInfoAwareConnection class MysqliConnection implements PingableConnection, ServerInfoAwareConnection
{ {
/** /**
* Name of the option to set connection flags * Name of the option to set connection flags
......
...@@ -12,7 +12,7 @@ use function assert; ...@@ -12,7 +12,7 @@ use function assert;
* *
* Used by all PDO-based drivers. * Used by all PDO-based drivers.
*/ */
class PDOConnection implements Connection, ServerInfoAwareConnection class PDOConnection implements ServerInfoAwareConnection
{ {
/** @var PDO */ /** @var PDO */
private $connection; private $connection;
......
...@@ -7,7 +7,7 @@ namespace Doctrine\DBAL\Driver; ...@@ -7,7 +7,7 @@ namespace Doctrine\DBAL\Driver;
/** /**
* An interface for connections which support a "native" ping method. * 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 * Pings the database server to determine if the connection is still
......
...@@ -4,7 +4,6 @@ declare(strict_types=1); ...@@ -4,7 +4,6 @@ declare(strict_types=1);
namespace Doctrine\DBAL\Driver\SQLAnywhere; namespace Doctrine\DBAL\Driver\SQLAnywhere;
use Doctrine\DBAL\Driver\Connection;
use Doctrine\DBAL\Driver\ResultStatement; use Doctrine\DBAL\Driver\ResultStatement;
use Doctrine\DBAL\Driver\ServerInfoAwareConnection; use Doctrine\DBAL\Driver\ServerInfoAwareConnection;
use Doctrine\DBAL\Driver\Statement as DriverStatement; use Doctrine\DBAL\Driver\Statement as DriverStatement;
...@@ -24,7 +23,7 @@ use function sasql_set_option; ...@@ -24,7 +23,7 @@ use function sasql_set_option;
/** /**
* SAP Sybase SQL Anywhere implementation of the Connection interface. * 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. */ /** @var resource The SQL Anywhere connection resource. */
private $connection; private $connection;
......
...@@ -4,7 +4,6 @@ declare(strict_types=1); ...@@ -4,7 +4,6 @@ declare(strict_types=1);
namespace Doctrine\DBAL\Driver\SQLSrv; namespace Doctrine\DBAL\Driver\SQLSrv;
use Doctrine\DBAL\Driver\Connection;
use Doctrine\DBAL\Driver\ResultStatement; use Doctrine\DBAL\Driver\ResultStatement;
use Doctrine\DBAL\Driver\ServerInfoAwareConnection; use Doctrine\DBAL\Driver\ServerInfoAwareConnection;
use Doctrine\DBAL\Driver\Statement as DriverStatement; use Doctrine\DBAL\Driver\Statement as DriverStatement;
...@@ -21,7 +20,7 @@ use function str_replace; ...@@ -21,7 +20,7 @@ use function str_replace;
/** /**
* SQL Server implementation for the Connection interface. * SQL Server implementation for the Connection interface.
*/ */
class SQLSrvConnection implements Connection, ServerInfoAwareConnection class SQLSrvConnection implements ServerInfoAwareConnection
{ {
/** @var resource */ /** @var resource */
protected $conn; protected $conn;
......
...@@ -7,7 +7,7 @@ namespace Doctrine\DBAL\Driver; ...@@ -7,7 +7,7 @@ namespace Doctrine\DBAL\Driver;
/** /**
* Contract for a connection that is able to provide information about the server it is connected to. * 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. * Returns the version number of the database server connected to.
......
...@@ -676,7 +676,7 @@ class ConnectionTest extends DbalTestCase ...@@ -676,7 +676,7 @@ class ConnectionTest extends DbalTestCase
$driverMock = $this->createMock(VersionAwarePlatformDriver::class); $driverMock = $this->createMock(VersionAwarePlatformDriver::class);
/** @var DriverConnection|ServerInfoAwareConnection|MockObject $driverConnectionMock */ /** @var DriverConnection|ServerInfoAwareConnection|MockObject $driverConnectionMock */
$driverConnectionMock = $this->createMock([DriverConnection::class, ServerInfoAwareConnection::class]); $driverConnectionMock = $this->createMock(ServerInfoAwareConnection::class);
/** @var AbstractPlatform|MockObject $platformMock */ /** @var AbstractPlatform|MockObject $platformMock */
$platformMock = $this->getMockForAbstractClass(AbstractPlatform::class); $platformMock = $this->getMockForAbstractClass(AbstractPlatform::class);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment