Skip to content

Commit

Permalink
Set more specific result type in Connection methods `createCommand(…
Browse files Browse the repository at this point in the history
…)` and `createTransaction()`
  • Loading branch information
vjik committed Oct 19, 2024
1 parent 67a0aa2 commit bd84444
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 2 additions & 4 deletions src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);

Expand All @@ -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);
}
Expand Down

0 comments on commit bd84444

Please sign in to comment.