From e08a651a40925a417a411d06f3f12478e3881a29 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Tue, 3 Sep 2024 18:20:04 +0200 Subject: [PATCH] renamed interfaces (BC break) Dibi\Driver => Dibi\Drivers\Connection Dibi\ResultDriver => Dibi\Drivers\Result Dibi\Reflector => Dibi\Drivers\Engine --- src/Dibi/Connection.php | 10 +- src/Dibi/Drivers/Connection.php | 97 ++++++++++++ src/Dibi/Drivers/DummyDriver.php | 6 +- src/Dibi/Drivers/Engine.php | 40 +++++ src/Dibi/Drivers/FirebirdDriver.php | 6 +- src/Dibi/Drivers/FirebirdReflector.php | 5 +- src/Dibi/Drivers/FirebirdResult.php | 2 +- src/Dibi/Drivers/MySqlReflector.php | 4 +- src/Dibi/Drivers/MySqliDriver.php | 6 +- src/Dibi/Drivers/MySqliResult.php | 2 +- src/Dibi/Drivers/NoDataResult.php | 3 +- src/Dibi/Drivers/OdbcDriver.php | 6 +- src/Dibi/Drivers/OdbcReflector.php | 4 +- src/Dibi/Drivers/OdbcResult.php | 2 +- src/Dibi/Drivers/OracleDriver.php | 6 +- src/Dibi/Drivers/OracleReflector.php | 4 +- src/Dibi/Drivers/OracleResult.php | 2 +- src/Dibi/Drivers/PdoDriver.php | 6 +- src/Dibi/Drivers/PdoResult.php | 2 +- src/Dibi/Drivers/PostgreDriver.php | 6 +- src/Dibi/Drivers/PostgreReflector.php | 5 +- src/Dibi/Drivers/PostgreResult.php | 3 +- src/Dibi/Drivers/Result.php | 58 ++++++++ src/Dibi/Drivers/SqliteDriver.php | 6 +- src/Dibi/Drivers/SqliteReflector.php | 5 +- src/Dibi/Drivers/SqliteResult.php | 2 +- src/Dibi/Drivers/SqlsrvDriver.php | 6 +- src/Dibi/Drivers/SqlsrvReflector.php | 4 +- src/Dibi/Drivers/SqlsrvResult.php | 2 +- src/Dibi/Helpers.php | 2 +- src/Dibi/IDataSource.php | 20 +++ src/Dibi/Reflection/Column.php | 2 +- src/Dibi/Reflection/Database.php | 2 +- src/Dibi/Reflection/Result.php | 4 +- src/Dibi/Reflection/Table.php | 4 +- src/Dibi/Result.php | 6 +- src/Dibi/Translator.php | 4 +- src/Dibi/interfaces.php | 180 ----------------------- tests/dibi/Connection.connect.phpt | 2 +- tests/dibi/Fluent.fetch.limit.mssql.phpt | 2 +- 40 files changed, 284 insertions(+), 254 deletions(-) create mode 100644 src/Dibi/Drivers/Connection.php create mode 100644 src/Dibi/Drivers/Engine.php create mode 100644 src/Dibi/Drivers/Result.php create mode 100644 src/Dibi/IDataSource.php delete mode 100644 src/Dibi/interfaces.php diff --git a/src/Dibi/Connection.php b/src/Dibi/Connection.php index 3cb40eac..7ec88463 100644 --- a/src/Dibi/Connection.php +++ b/src/Dibi/Connection.php @@ -27,7 +27,7 @@ class Connection /** @var string[] resultset formats */ private array $formats; - private ?Driver $driver = null; + private ?Drivers\Connection $driver = null; private ?Translator $translator = null; /** @var array */ @@ -120,12 +120,12 @@ public function __destruct() */ final public function connect(): void { - if ($this->config['driver'] instanceof Driver) { + if ($this->config['driver'] instanceof Drivers\Connection) { $this->driver = $this->config['driver']; $this->translator = new Translator($this); return; - } elseif (is_subclass_of($this->config['driver'], Driver::class)) { + } elseif (is_subclass_of($this->config['driver'], Drivers\Connection::class)) { $class = $this->config['driver']; } else { @@ -196,7 +196,7 @@ final public function getConfig(?string $key = null, $default = null): mixed /** * Returns the driver and connects to a database in lazy mode. */ - final public function getDriver(): Driver + final public function getDriver(): Drivers\Connection { if (!$this->driver) { $this->connect(); @@ -448,7 +448,7 @@ public function transaction(callable $callback): mixed /** * Result set factory. */ - public function createResultSet(ResultDriver $resultDriver): Result + public function createResultSet(Drivers\Result $resultDriver): Result { return (new Result($resultDriver, $this->config['result']['normalize'] ?? true)) ->setFormats($this->formats); diff --git a/src/Dibi/Drivers/Connection.php b/src/Dibi/Drivers/Connection.php new file mode 100644 index 00000000..9ff28e70 --- /dev/null +++ b/src/Dibi/Drivers/Connection.php @@ -0,0 +1,97 @@ + buffers is the number of database buffers to allocate for the server-side cache. If 0 or omitted, server chooses its own default. * - resource (resource) => existing connection resource */ -class FirebirdDriver implements Dibi\Driver +class FirebirdDriver implements Connection { public const ErrorExceptionThrown = -836; @@ -85,7 +85,7 @@ public function disconnect(): void * Executes the SQL query. * @throws Dibi\DriverException|Dibi\Exception */ - public function query(string $sql): ?Dibi\ResultDriver + public function query(string $sql): ?Result { $resource = $this->inTransaction ? $this->transaction @@ -199,7 +199,7 @@ public function getResource(): mixed /** * Returns the connection reflector. */ - public function getReflector(): Dibi\Reflector + public function getReflector(): Engine { return new FirebirdReflector($this); } diff --git a/src/Dibi/Drivers/FirebirdReflector.php b/src/Dibi/Drivers/FirebirdReflector.php index 9b23fdd3..292c800b 100644 --- a/src/Dibi/Drivers/FirebirdReflector.php +++ b/src/Dibi/Drivers/FirebirdReflector.php @@ -9,16 +9,15 @@ namespace Dibi\Drivers; -use Dibi; /** * The reflector for Firebird/InterBase database. */ -class FirebirdReflector implements Dibi\Reflector +class FirebirdReflector implements Engine { public function __construct( - private readonly Dibi\Driver $driver, + private readonly Connection $driver, ) { } diff --git a/src/Dibi/Drivers/FirebirdResult.php b/src/Dibi/Drivers/FirebirdResult.php index 38ca75c5..f3bf3966 100644 --- a/src/Dibi/Drivers/FirebirdResult.php +++ b/src/Dibi/Drivers/FirebirdResult.php @@ -16,7 +16,7 @@ /** * The driver for Firebird/InterBase result set. */ -class FirebirdResult implements Dibi\ResultDriver +class FirebirdResult implements Result { public function __construct( /** @var resource */ diff --git a/src/Dibi/Drivers/MySqlReflector.php b/src/Dibi/Drivers/MySqlReflector.php index 0f968a71..ecf1cfa2 100644 --- a/src/Dibi/Drivers/MySqlReflector.php +++ b/src/Dibi/Drivers/MySqlReflector.php @@ -16,10 +16,10 @@ * The reflector for MySQL databases. * @internal */ -class MySqlReflector implements Dibi\Reflector +class MySqlReflector implements Engine { public function __construct( - private readonly Dibi\Driver $driver, + private readonly Connection $driver, ) { } diff --git a/src/Dibi/Drivers/MySqliDriver.php b/src/Dibi/Drivers/MySqliDriver.php index 41e7c606..3bf130df 100644 --- a/src/Dibi/Drivers/MySqliDriver.php +++ b/src/Dibi/Drivers/MySqliDriver.php @@ -30,7 +30,7 @@ * - sqlmode => see http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html * - resource (mysqli) => existing connection resource */ -class MySqliDriver implements Dibi\Driver +class MySqliDriver implements Connection { public const ErrorAccessDenied = 1045; public const ErrorDuplicateEntry = 1062; @@ -146,7 +146,7 @@ public function ping(): bool * Executes the SQL query. * @throws Dibi\DriverException */ - public function query(string $sql): ?Dibi\ResultDriver + public function query(string $sql): ?Result { $res = @$this->connection->query($sql, $this->buffered ? MYSQLI_STORE_RESULT : MYSQLI_USE_RESULT); // intentionally @ @@ -263,7 +263,7 @@ public function getResource(): ?\mysqli /** * Returns the connection reflector. */ - public function getReflector(): Dibi\Reflector + public function getReflector(): Engine { return new MySqlReflector($this); } diff --git a/src/Dibi/Drivers/MySqliResult.php b/src/Dibi/Drivers/MySqliResult.php index c993c943..59c5058a 100644 --- a/src/Dibi/Drivers/MySqliResult.php +++ b/src/Dibi/Drivers/MySqliResult.php @@ -15,7 +15,7 @@ /** * The driver for MySQL result set. */ -class MySqliResult implements Dibi\ResultDriver +class MySqliResult implements Result { public function __construct( private readonly \mysqli_result $resultSet, diff --git a/src/Dibi/Drivers/NoDataResult.php b/src/Dibi/Drivers/NoDataResult.php index 480db598..7f5190a5 100644 --- a/src/Dibi/Drivers/NoDataResult.php +++ b/src/Dibi/Drivers/NoDataResult.php @@ -9,13 +9,12 @@ namespace Dibi\Drivers; -use Dibi; /** * The driver for no result set. */ -class NoDataResult implements Dibi\ResultDriver +class NoDataResult implements Result { public function __construct( private readonly int $rows, diff --git a/src/Dibi/Drivers/OdbcDriver.php b/src/Dibi/Drivers/OdbcDriver.php index a5471c35..f1e216e3 100644 --- a/src/Dibi/Drivers/OdbcDriver.php +++ b/src/Dibi/Drivers/OdbcDriver.php @@ -23,7 +23,7 @@ * - resource (resource) => existing connection resource * - microseconds (bool) => use microseconds in datetime format? */ -class OdbcDriver implements Dibi\Driver +class OdbcDriver implements Connection { /** @var resource */ private $connection; @@ -76,7 +76,7 @@ public function disconnect(): void * Executes the SQL query. * @throws Dibi\DriverException */ - public function query(string $sql): ?Dibi\ResultDriver + public function query(string $sql): ?Result { $this->affectedRows = null; $res = @odbc_exec($this->connection, $sql); // intentionally @ @@ -175,7 +175,7 @@ public function getResource(): mixed /** * Returns the connection reflector. */ - public function getReflector(): Dibi\Reflector + public function getReflector(): Engine { return new OdbcReflector($this); } diff --git a/src/Dibi/Drivers/OdbcReflector.php b/src/Dibi/Drivers/OdbcReflector.php index 0ec04a4c..a9da505c 100644 --- a/src/Dibi/Drivers/OdbcReflector.php +++ b/src/Dibi/Drivers/OdbcReflector.php @@ -15,10 +15,10 @@ /** * The reflector for ODBC connections. */ -class OdbcReflector implements Dibi\Reflector +class OdbcReflector implements Engine { public function __construct( - private readonly Dibi\Driver $driver, + private readonly Connection $driver, ) { } diff --git a/src/Dibi/Drivers/OdbcResult.php b/src/Dibi/Drivers/OdbcResult.php index 3a985a83..9417272d 100644 --- a/src/Dibi/Drivers/OdbcResult.php +++ b/src/Dibi/Drivers/OdbcResult.php @@ -15,7 +15,7 @@ /** * The driver interacting with result set via ODBC connections. */ -class OdbcResult implements Dibi\ResultDriver +class OdbcResult implements Result { private int $row = 0; diff --git a/src/Dibi/Drivers/OracleDriver.php b/src/Dibi/Drivers/OracleDriver.php index 46a757db..17ebbabc 100644 --- a/src/Dibi/Drivers/OracleDriver.php +++ b/src/Dibi/Drivers/OracleDriver.php @@ -25,7 +25,7 @@ * - resource (resource) => existing connection resource * - persistent => Creates persistent connections with oci_pconnect instead of oci_new_connect */ -class OracleDriver implements Dibi\Driver +class OracleDriver implements Connection { /** @var resource */ private $connection; @@ -76,7 +76,7 @@ public function disconnect(): void * Executes the SQL query. * @throws Dibi\DriverException */ - public function query(string $sql): ?Dibi\ResultDriver + public function query(string $sql): ?Result { $this->affectedRows = null; $res = oci_parse($this->connection, $sql); @@ -189,7 +189,7 @@ public function getResource(): mixed /** * Returns the connection reflector. */ - public function getReflector(): Dibi\Reflector + public function getReflector(): Engine { return new OracleReflector($this); } diff --git a/src/Dibi/Drivers/OracleReflector.php b/src/Dibi/Drivers/OracleReflector.php index 1ab4962d..8ffa5e18 100644 --- a/src/Dibi/Drivers/OracleReflector.php +++ b/src/Dibi/Drivers/OracleReflector.php @@ -15,10 +15,10 @@ /** * The reflector for Oracle database. */ -class OracleReflector implements Dibi\Reflector +class OracleReflector implements Engine { public function __construct( - private readonly Dibi\Driver $driver, + private readonly Connection $driver, ) { } diff --git a/src/Dibi/Drivers/OracleResult.php b/src/Dibi/Drivers/OracleResult.php index ca691559..8a96cbca 100644 --- a/src/Dibi/Drivers/OracleResult.php +++ b/src/Dibi/Drivers/OracleResult.php @@ -15,7 +15,7 @@ /** * The driver for Oracle result set. */ -class OracleResult implements Dibi\ResultDriver +class OracleResult implements Result { public function __construct( /** @var resource */ diff --git a/src/Dibi/Drivers/PdoDriver.php b/src/Dibi/Drivers/PdoDriver.php index d0a112b1..81f64765 100644 --- a/src/Dibi/Drivers/PdoDriver.php +++ b/src/Dibi/Drivers/PdoDriver.php @@ -24,7 +24,7 @@ * - options (array) => driver specific options {@see PDO::__construct} * - resource (PDO) => existing connection */ -class PdoDriver implements Dibi\Driver +class PdoDriver implements Connection { private ?PDO $connection; private ?int $affectedRows; @@ -79,7 +79,7 @@ public function disconnect(): void * Executes the SQL query. * @throws Dibi\DriverException */ - public function query(string $sql): ?Dibi\ResultDriver + public function query(string $sql): ?Result { $res = $this->connection->query($sql); if ($res) { @@ -171,7 +171,7 @@ public function getResource(): ?PDO /** * Returns the connection reflector. */ - public function getReflector(): Dibi\Reflector + public function getReflector(): Engine { return match ($this->driverName) { 'mysql' => new MySqlReflector($this), diff --git a/src/Dibi/Drivers/PdoResult.php b/src/Dibi/Drivers/PdoResult.php index bfb0f602..1bb1673c 100644 --- a/src/Dibi/Drivers/PdoResult.php +++ b/src/Dibi/Drivers/PdoResult.php @@ -17,7 +17,7 @@ /** * The driver for PDO result set. */ -class PdoResult implements Dibi\ResultDriver +class PdoResult implements Result { public function __construct( private ?\PDOStatement $resultSet, diff --git a/src/Dibi/Drivers/PostgreDriver.php b/src/Dibi/Drivers/PostgreDriver.php index b9b0603c..45ac4162 100644 --- a/src/Dibi/Drivers/PostgreDriver.php +++ b/src/Dibi/Drivers/PostgreDriver.php @@ -26,7 +26,7 @@ * - resource (PgSql\Connection) => existing connection resource * - connect_type (int) => see pg_connect() */ -class PostgreDriver implements Dibi\Driver +class PostgreDriver implements Connection { private PgSql\Connection $connection; private ?int $affectedRows; @@ -109,7 +109,7 @@ public function ping(): bool * Executes the SQL query. * @throws Dibi\DriverException */ - public function query(string $sql): ?Dibi\ResultDriver + public function query(string $sql): ?Result { $this->affectedRows = null; $res = @pg_query($this->connection, $sql); // intentionally @ @@ -231,7 +231,7 @@ public function getResource(): PgSql\Connection /** * Returns the connection reflector. */ - public function getReflector(): Dibi\Reflector + public function getReflector(): Engine { return new PostgreReflector($this); } diff --git a/src/Dibi/Drivers/PostgreReflector.php b/src/Dibi/Drivers/PostgreReflector.php index ab93130c..c16a9b63 100644 --- a/src/Dibi/Drivers/PostgreReflector.php +++ b/src/Dibi/Drivers/PostgreReflector.php @@ -9,16 +9,15 @@ namespace Dibi\Drivers; -use Dibi; /** * The reflector for PostgreSQL database. */ -class PostgreReflector implements Dibi\Reflector +class PostgreReflector implements Engine { public function __construct( - private readonly Dibi\Driver $driver, + private readonly Connection $driver, ) { } diff --git a/src/Dibi/Drivers/PostgreResult.php b/src/Dibi/Drivers/PostgreResult.php index e74f36ca..dc975465 100644 --- a/src/Dibi/Drivers/PostgreResult.php +++ b/src/Dibi/Drivers/PostgreResult.php @@ -9,7 +9,6 @@ namespace Dibi\Drivers; -use Dibi; use Dibi\Helpers; use PgSql; @@ -17,7 +16,7 @@ /** * The driver for PostgreSQL result set. */ -class PostgreResult implements Dibi\ResultDriver +class PostgreResult implements Result { public function __construct( private readonly PgSql\Result $resultSet, diff --git a/src/Dibi/Drivers/Result.php b/src/Dibi/Drivers/Result.php new file mode 100644 index 00000000..f90658b3 --- /dev/null +++ b/src/Dibi/Drivers/Result.php @@ -0,0 +1,58 @@ + how to format datetime in SQL (@see date) * - resource (SQLite3) => existing connection resource */ -class SqliteDriver implements Dibi\Driver +class SqliteDriver implements Connection { private SQLite3 $connection; private string $fmtDate; @@ -73,7 +73,7 @@ public function disconnect(): void * Executes the SQL query. * @throws Dibi\DriverException */ - public function query(string $sql): ?Dibi\ResultDriver + public function query(string $sql): ?Result { $res = @$this->connection->query($sql); // intentionally @ if ($code = $this->connection->lastErrorCode()) { @@ -174,7 +174,7 @@ public function getResource(): ?SQLite3 /** * Returns the connection reflector. */ - public function getReflector(): Dibi\Reflector + public function getReflector(): Engine { return new SqliteReflector($this); } diff --git a/src/Dibi/Drivers/SqliteReflector.php b/src/Dibi/Drivers/SqliteReflector.php index 8c1e3ade..d2c449a9 100644 --- a/src/Dibi/Drivers/SqliteReflector.php +++ b/src/Dibi/Drivers/SqliteReflector.php @@ -9,16 +9,15 @@ namespace Dibi\Drivers; -use Dibi; /** * The reflector for SQLite database. */ -class SqliteReflector implements Dibi\Reflector +class SqliteReflector implements Engine { public function __construct( - private readonly Dibi\Driver $driver, + private readonly Connection $driver, ) { } diff --git a/src/Dibi/Drivers/SqliteResult.php b/src/Dibi/Drivers/SqliteResult.php index c3fef40e..dede2d29 100644 --- a/src/Dibi/Drivers/SqliteResult.php +++ b/src/Dibi/Drivers/SqliteResult.php @@ -16,7 +16,7 @@ /** * The driver for SQLite result set. */ -class SqliteResult implements Dibi\ResultDriver +class SqliteResult implements Result { public function __construct( private readonly \SQLite3Result $resultSet, diff --git a/src/Dibi/Drivers/SqlsrvDriver.php b/src/Dibi/Drivers/SqlsrvDriver.php index 0a999335..b3d8d46e 100644 --- a/src/Dibi/Drivers/SqlsrvDriver.php +++ b/src/Dibi/Drivers/SqlsrvDriver.php @@ -25,7 +25,7 @@ * - charset => character encoding to set (default is UTF-8) * - resource (resource) => existing connection resource */ -class SqlsrvDriver implements Dibi\Driver +class SqlsrvDriver implements Connection { /** @var resource */ private $connection; @@ -83,7 +83,7 @@ public function disconnect(): void * Executes the SQL query. * @throws Dibi\DriverException */ - public function query(string $sql): ?Dibi\ResultDriver + public function query(string $sql): ?Result { $this->affectedRows = null; $res = sqlsrv_query($this->connection, $sql); @@ -170,7 +170,7 @@ public function getResource(): mixed /** * Returns the connection reflector. */ - public function getReflector(): Dibi\Reflector + public function getReflector(): Engine { return new SqlsrvReflector($this); } diff --git a/src/Dibi/Drivers/SqlsrvReflector.php b/src/Dibi/Drivers/SqlsrvReflector.php index b19249a7..46b95f6c 100644 --- a/src/Dibi/Drivers/SqlsrvReflector.php +++ b/src/Dibi/Drivers/SqlsrvReflector.php @@ -15,10 +15,10 @@ /** * The reflector for Microsoft SQL Server and SQL Azure databases. */ -class SqlsrvReflector implements Dibi\Reflector +class SqlsrvReflector implements Engine { public function __construct( - private readonly Dibi\Driver $driver, + private readonly Connection $driver, ) { } diff --git a/src/Dibi/Drivers/SqlsrvResult.php b/src/Dibi/Drivers/SqlsrvResult.php index 8ad14a74..1f692ab0 100644 --- a/src/Dibi/Drivers/SqlsrvResult.php +++ b/src/Dibi/Drivers/SqlsrvResult.php @@ -15,7 +15,7 @@ /** * The driver for Microsoft SQL Server and SQL Azure result set. */ -class SqlsrvResult implements Dibi\ResultDriver +class SqlsrvResult implements Result { public function __construct( /** @var resource */ diff --git a/src/Dibi/Helpers.php b/src/Dibi/Helpers.php index 83fca323..40bcba18 100644 --- a/src/Dibi/Helpers.php +++ b/src/Dibi/Helpers.php @@ -156,7 +156,7 @@ public static function getSuggestion(array $items, string $value): ?string /** @internal */ - public static function escape(Driver $driver, $value, string $type): string + public static function escape(Drivers\Connection $driver, $value, string $type): string { $types = [ Type::Text => 'text', diff --git a/src/Dibi/IDataSource.php b/src/Dibi/IDataSource.php new file mode 100644 index 00000000..0565fc45 --- /dev/null +++ b/src/Dibi/IDataSource.php @@ -0,0 +1,20 @@ +columns)) { $this->columns = []; - $reflector = $this->driver instanceof Dibi\Reflector + $reflector = $this->driver instanceof Dibi\Drivers\Engine ? $this->driver : null; foreach ($this->driver->getResultColumns() as $info) { diff --git a/src/Dibi/Reflection/Table.php b/src/Dibi/Reflection/Table.php index 7c5b64ed..e262add4 100644 --- a/src/Dibi/Reflection/Table.php +++ b/src/Dibi/Reflection/Table.php @@ -25,7 +25,7 @@ */ class Table { - private readonly Dibi\Reflector $reflector; + private readonly Dibi\Drivers\Engine $reflector; private string $name; private bool $view; @@ -40,7 +40,7 @@ class Table private ?Index $primaryKey; - public function __construct(Dibi\Reflector $reflector, array $info) + public function __construct(Dibi\Drivers\Engine $reflector, array $info) { $this->reflector = $reflector; $this->name = $info['name']; diff --git a/src/Dibi/Result.php b/src/Dibi/Result.php index 24f4513d..45a3b882 100644 --- a/src/Dibi/Result.php +++ b/src/Dibi/Result.php @@ -17,7 +17,7 @@ */ class Result implements IDataSource { - private ?ResultDriver $driver; + private ?Drivers\Result $driver; /** Translate table */ private array $types = []; @@ -34,7 +34,7 @@ class Result implements IDataSource private array $formats = []; - public function __construct(ResultDriver $driver, bool $normalize = true) + public function __construct(Drivers\Result $driver, bool $normalize = true) { $this->driver = $driver; if ($normalize) { @@ -59,7 +59,7 @@ final public function free(): void * Safe access to property $driver. * @throws \RuntimeException */ - final public function getResultDriver(): ResultDriver + final public function getResultDriver(): Drivers\Result { if ($this->driver === null) { throw new \RuntimeException('Result-set was released from memory.'); diff --git a/src/Dibi/Translator.php b/src/Dibi/Translator.php index 8dc4063e..4fefa673 100644 --- a/src/Dibi/Translator.php +++ b/src/Dibi/Translator.php @@ -15,8 +15,8 @@ */ final class Translator { - private readonly Connection $connection; - private readonly Driver $driver; + private Connection $connection; + private readonly Drivers\Connection $driver; private int $cursor = 0; private array $args; diff --git a/src/Dibi/interfaces.php b/src/Dibi/interfaces.php deleted file mode 100644 index 753d0b6e..00000000 --- a/src/Dibi/interfaces.php +++ /dev/null @@ -1,180 +0,0 @@ -getConfig('lazy')); Assert::same($config['driver'], $conn->getConfig('driver')); - Assert::type(Dibi\Driver::class, $conn->getDriver()); + Assert::type(Dibi\Drivers\Connection::class, $conn->getDriver()); }); diff --git a/tests/dibi/Fluent.fetch.limit.mssql.phpt b/tests/dibi/Fluent.fetch.limit.mssql.phpt index 7df79eb1..c5789da1 100644 --- a/tests/dibi/Fluent.fetch.limit.mssql.phpt +++ b/tests/dibi/Fluent.fetch.limit.mssql.phpt @@ -19,7 +19,7 @@ class MockDriver extends Dibi\Drivers\SqlsrvDriver } - public function query(string $sql): ?Dibi\ResultDriver + public function query(string $sql): ?Dibi\Drivers\Result { return new MockResult; }