VersionAwarePlatformDriver now extends Driver

parent b4d076e3
# Upgrade to 3.0 # Upgrade to 3.0
## 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.
## BC BREAK: Removed support for PostgreSQL 9.3 and older ## BC BREAK: Removed support for PostgreSQL 9.3 and older
DBAL now requires PostgeSQL 9.4 or newer, support for unmaintained versions has been dropped. DBAL now requires PostgeSQL 9.4 or newer, support for unmaintained versions has been dropped.
......
...@@ -6,7 +6,6 @@ namespace Doctrine\DBAL\Driver; ...@@ -6,7 +6,6 @@ namespace Doctrine\DBAL\Driver;
use Doctrine\DBAL\Connection; use Doctrine\DBAL\Connection;
use Doctrine\DBAL\DBALException; use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Driver;
use Doctrine\DBAL\Driver\DriverException as DriverExceptionInterface; use Doctrine\DBAL\Driver\DriverException as DriverExceptionInterface;
use Doctrine\DBAL\Exception; use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Exception\DriverException; use Doctrine\DBAL\Exception\DriverException;
...@@ -26,7 +25,7 @@ use function version_compare; ...@@ -26,7 +25,7 @@ use function version_compare;
/** /**
* Abstract base implementation of the {@link Doctrine\DBAL\Driver} interface for MySQL based drivers. * Abstract base implementation of the {@link Doctrine\DBAL\Driver} interface for MySQL based drivers.
*/ */
abstract class AbstractMySQLDriver implements Driver, ExceptionConverterDriver, VersionAwarePlatformDriver abstract class AbstractMySQLDriver implements ExceptionConverterDriver, VersionAwarePlatformDriver
{ {
/** /**
* {@inheritdoc} * {@inheritdoc}
......
...@@ -5,7 +5,6 @@ declare(strict_types=1); ...@@ -5,7 +5,6 @@ declare(strict_types=1);
namespace Doctrine\DBAL\Driver; namespace Doctrine\DBAL\Driver;
use Doctrine\DBAL\Connection; use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Driver;
use Doctrine\DBAL\Driver\DriverException as DriverExceptionInterface; use Doctrine\DBAL\Driver\DriverException as DriverExceptionInterface;
use Doctrine\DBAL\Exception; use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Exception\DriverException; use Doctrine\DBAL\Exception\DriverException;
...@@ -23,7 +22,7 @@ use function version_compare; ...@@ -23,7 +22,7 @@ use function version_compare;
/** /**
* Abstract base implementation of the {@link Doctrine\DBAL\Driver} interface for PostgreSQL based drivers. * Abstract base implementation of the {@link Doctrine\DBAL\Driver} interface for PostgreSQL based drivers.
*/ */
abstract class AbstractPostgreSQLDriver implements Driver, ExceptionConverterDriver, VersionAwarePlatformDriver abstract class AbstractPostgreSQLDriver implements ExceptionConverterDriver, VersionAwarePlatformDriver
{ {
/** /**
* {@inheritdoc} * {@inheritdoc}
......
...@@ -5,7 +5,6 @@ declare(strict_types=1); ...@@ -5,7 +5,6 @@ declare(strict_types=1);
namespace Doctrine\DBAL\Driver; namespace Doctrine\DBAL\Driver;
use Doctrine\DBAL\Connection; use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Driver;
use Doctrine\DBAL\Driver\DriverException as DriverExceptionInterface; use Doctrine\DBAL\Driver\DriverException as DriverExceptionInterface;
use Doctrine\DBAL\Exception; use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Exception\DriverException; use Doctrine\DBAL\Exception\DriverException;
...@@ -20,7 +19,7 @@ use function preg_match; ...@@ -20,7 +19,7 @@ use function preg_match;
/** /**
* Abstract base implementation of the {@link Doctrine\DBAL\Driver} interface for SAP Sybase SQL Anywhere based drivers. * Abstract base implementation of the {@link Doctrine\DBAL\Driver} interface for SAP Sybase SQL Anywhere based drivers.
*/ */
abstract class AbstractSQLAnywhereDriver implements Driver, ExceptionConverterDriver, VersionAwarePlatformDriver abstract class AbstractSQLAnywhereDriver implements ExceptionConverterDriver, VersionAwarePlatformDriver
{ {
/** /**
* {@inheritdoc} * {@inheritdoc}
......
...@@ -5,7 +5,6 @@ declare(strict_types=1); ...@@ -5,7 +5,6 @@ declare(strict_types=1);
namespace Doctrine\DBAL\Driver; namespace Doctrine\DBAL\Driver;
use Doctrine\DBAL\Connection; use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Driver;
use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\Exception\InvalidPlatformVersion; use Doctrine\DBAL\Platforms\Exception\InvalidPlatformVersion;
use Doctrine\DBAL\Platforms\SQLServer2012Platform; use Doctrine\DBAL\Platforms\SQLServer2012Platform;
...@@ -19,7 +18,7 @@ use function version_compare; ...@@ -19,7 +18,7 @@ use function version_compare;
/** /**
* Abstract base implementation of the {@link Doctrine\DBAL\Driver} interface for Microsoft SQL Server based drivers. * Abstract base implementation of the {@link Doctrine\DBAL\Driver} interface for Microsoft SQL Server based drivers.
*/ */
abstract class AbstractSQLServerDriver implements Driver, VersionAwarePlatformDriver abstract class AbstractSQLServerDriver implements VersionAwarePlatformDriver
{ {
/** /**
* {@inheritdoc} * {@inheritdoc}
......
...@@ -14,7 +14,7 @@ use Doctrine\DBAL\Platforms\AbstractPlatform; ...@@ -14,7 +14,7 @@ use Doctrine\DBAL\Platforms\AbstractPlatform;
* This interface should be implemented by drivers that are capable to do this * This interface should be implemented by drivers that are capable to do this
* distinction. * distinction.
*/ */
interface VersionAwarePlatformDriver interface VersionAwarePlatformDriver extends Driver
{ {
/** /**
* Factory method for creating the appropriate platform instance for the given version. * Factory method for creating the appropriate platform instance for the given version.
......
...@@ -672,8 +672,8 @@ class ConnectionTest extends DbalTestCase ...@@ -672,8 +672,8 @@ class ConnectionTest extends DbalTestCase
*/ */
public function testPlatformDetectionIsTriggerOnlyOnceOnRetrievingPlatform() : void public function testPlatformDetectionIsTriggerOnlyOnceOnRetrievingPlatform() : void
{ {
/** @var Driver|VersionAwarePlatformDriver|MockObject $driverMock */ /** @var VersionAwarePlatformDriver|MockObject $driverMock */
$driverMock = $this->createMock([Driver::class, 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([DriverConnection::class, ServerInfoAwareConnection::class]);
...@@ -801,8 +801,8 @@ class ConnectionTest extends DbalTestCase ...@@ -801,8 +801,8 @@ class ConnectionTest extends DbalTestCase
*/ */
public function testRethrowsOriginalExceptionOnDeterminingPlatformWhenConnectingToNonExistentDatabase() : void public function testRethrowsOriginalExceptionOnDeterminingPlatformWhenConnectingToNonExistentDatabase() : void
{ {
/** @var Driver|VersionAwarePlatformDriver|MockObject $driverMock */ /** @var VersionAwarePlatformDriver|MockObject $driverMock */
$driverMock = $this->createMock([Driver::class, VersionAwarePlatformDriver::class]); $driverMock = $this->createMock(VersionAwarePlatformDriver::class);
$connection = new Connection(['dbname' => 'foo'], $driverMock); $connection = new Connection(['dbname' => 'foo'], $driverMock);
$originalException = new Exception('Original exception'); $originalException = new Exception('Original exception');
......
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