Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set more specific result type in Connection methods #324

Merged
merged 2 commits into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
"vimeo/psalm": "^5.25",
"yiisoft/aliases": "^2.0",
"yiisoft/cache-file": "^3.1",
"yiisoft/json": "^1.0",
Tigrov marked this conversation as resolved.
Show resolved Hide resolved
"yiisoft/var-dumper": "^1.5"
},
"autoload": {
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
Loading