From bd84444d93af85d2d945af9e61b5f882f2d481b7 Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Sat, 19 Oct 2024 19:40:53 +0300 Subject: [PATCH] Set more specific result type in `Connection` methods `createCommand()` and `createTransaction()` --- CHANGELOG.md | 1 + src/Connection.php | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 95627281..04b1c557 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ - Enh #320: Update according changes in `ColumnSchemaInterface` (@Tigrov) - New #322: Add `ColumnDefinitionBuilder` class (@Tigrov) - Enh #323: Refactor `Dsn` class (@Tigrov) +- Enh #324: Set more specific result type in `Connection` methods `createCommand()` and `createTransaction()` (@vjik) ## 1.2.0 March 21, 2024 diff --git a/src/Connection.php b/src/Connection.php index 14d209af..03345cc6 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -5,12 +5,10 @@ namespace Yiisoft\Db\Sqlite; use Yiisoft\Db\Driver\Pdo\AbstractPdoConnection; -use Yiisoft\Db\Driver\Pdo\PdoCommandInterface; use Yiisoft\Db\QueryBuilder\QueryBuilderInterface; use Yiisoft\Db\Schema\Quoter; use Yiisoft\Db\Schema\QuoterInterface; use Yiisoft\Db\Schema\SchemaInterface; -use Yiisoft\Db\Transaction\TransactionInterface; use function str_starts_with; @@ -34,7 +32,7 @@ public function __clone() } } - public function createCommand(string $sql = null, array $params = []): PdoCommandInterface + public function createCommand(string $sql = null, array $params = []): Command { $command = new Command($this); @@ -53,7 +51,7 @@ public function createCommand(string $sql = null, array $params = []): PdoComman return $command->bindValues($params); } - public function createTransaction(): TransactionInterface + public function createTransaction(): Transaction { return new Transaction($this); }