Remove deprecated driver classes

parent 190c1dc3
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
- `AbstractDriverException` - `AbstractDriverException`
- `DriverException` - `DriverException`
- `PDOException` - `PDOException`
- `IBMDB2\DB2Driver`
- `IBMDB2\DB2Exception` - `IBMDB2\DB2Exception`
- `Mysqli\MysqliException` - `Mysqli\MysqliException`
- `OCI8\OCI8Exception` - `OCI8\OCI8Exception`
......
<?php
namespace Doctrine\DBAL\Driver\IBMDB2;
use Doctrine\DBAL\Driver\AbstractDB2Driver;
/**
* IBM DB2 Driver.
*
* @deprecated Use {@link Driver} instead
*/
class DB2Driver extends AbstractDB2Driver
{
/**
* {@inheritdoc}
*/
public function connect(array $params)
{
return new Connection(
DataSourceName::fromConnectionParameters($params)->toString(),
isset($params['persistent']) && $params['persistent'] === true,
$params['user'] ?? '',
$params['password'] ?? '',
$params['driver_options'] ?? []
);
}
}
<?php <?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\IBMDB2; namespace Doctrine\DBAL\Driver\IBMDB2;
final class Driver extends DB2Driver use Doctrine\DBAL\Driver\AbstractDB2Driver;
final class Driver extends AbstractDB2Driver
{ {
/**
* {@inheritdoc}
*/
public function connect(array $params)
{
return new Connection(
DataSourceName::fromConnectionParameters($params)->toString(),
isset($params['persistent']) && $params['persistent'] === true,
$params['user'] ?? '',
$params['password'] ?? '',
$params['driver_options'] ?? []
);
}
} }
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
namespace Doctrine\DBAL\Tests\Functional\Driver\IBMDB2; namespace Doctrine\DBAL\Tests\Functional\Driver\IBMDB2;
use Doctrine\DBAL\Driver; use Doctrine\DBAL\Driver as DriverInterface;
use Doctrine\DBAL\Driver\IBMDB2\DB2Driver; use Doctrine\DBAL\Driver\IBMDB2\Driver;
use Doctrine\DBAL\Tests\Functional\Driver\AbstractDriverTest; use Doctrine\DBAL\Tests\Functional\Driver\AbstractDriverTest;
use function extension_loaded; use function extension_loaded;
...@@ -18,7 +18,7 @@ class DriverTest extends AbstractDriverTest ...@@ -18,7 +18,7 @@ class DriverTest extends AbstractDriverTest
parent::setUp(); parent::setUp();
if ($this->connection->getDriver() instanceof DB2Driver) { if ($this->connection->getDriver() instanceof Driver) {
return; return;
} }
...@@ -35,8 +35,8 @@ class DriverTest extends AbstractDriverTest ...@@ -35,8 +35,8 @@ class DriverTest extends AbstractDriverTest
self::markTestSkipped('IBM DB2 does not support connecting without database name.'); self::markTestSkipped('IBM DB2 does not support connecting without database name.');
} }
protected function createDriver(): Driver protected function createDriver(): DriverInterface
{ {
return new DB2Driver(); return new Driver();
} }
} }
...@@ -4,7 +4,7 @@ declare(strict_types=1); ...@@ -4,7 +4,7 @@ declare(strict_types=1);
namespace Doctrine\DBAL\Tests\Functional\Driver\IBMDB2; namespace Doctrine\DBAL\Tests\Functional\Driver\IBMDB2;
use Doctrine\DBAL\Driver\IBMDB2\DB2Driver; use Doctrine\DBAL\Driver\IBMDB2\Driver;
use Doctrine\DBAL\Driver\IBMDB2\Exception\StatementError; use Doctrine\DBAL\Driver\IBMDB2\Exception\StatementError;
use Doctrine\DBAL\Tests\FunctionalTestCase; use Doctrine\DBAL\Tests\FunctionalTestCase;
...@@ -24,7 +24,7 @@ class StatementTest extends FunctionalTestCase ...@@ -24,7 +24,7 @@ class StatementTest extends FunctionalTestCase
parent::setUp(); parent::setUp();
if ($this->connection->getDriver() instanceof DB2Driver) { if ($this->connection->getDriver() instanceof Driver) {
return; return;
} }
......
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