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); }