Skip to content
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 @@ -17,6 +17,7 @@
- New #360: Realize `ColumnBuilder` class (@Tigrov)
- Enh #362: Update according changes in `ColumnSchemaInterface` (@Tigrov)
- New #364: Add `ColumnDefinitionBuilder` class (@Tigrov)
- Enh #365: Refactor `Dsn` class (@Tigrov)

## 1.3.0 March 21, 2024

Expand Down
6 changes: 3 additions & 3 deletions src/Dsn.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
final class Dsn extends AbstractDsn
{
/**
* @psalm-param string[] $options
* @psalm-param array<string,string> $options
*/
public function __construct(
string $driver,
string $host,
string $driver = 'pgsql',
string $host = '127.0.0.1',
string|null $databaseName = 'postgres',
string $port = '5432',
array $options = []
Expand Down
4 changes: 2 additions & 2 deletions tests/Support/TestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ protected function getConnection(bool $fixture = false): PdoConnectionInterface

protected static function getDb(): PdoConnectionInterface
{
$dsn = (new Dsn('pgsql', '127.0.0.1', 'yiitest', '5432'))->asString();
$dsn = (new Dsn(databaseName: 'yiitest'))->asString();

return new Connection(new Driver($dsn, 'root', 'root'), DbHelper::getSchemaCache());
}

protected function getDsn(): string
{
if ($this->dsn === '') {
$this->dsn = (new Dsn('pgsql', '127.0.0.1', 'yiitest', '5432'))->asString();
$this->dsn = (new Dsn(databaseName: 'yiitest'))->asString();
}

return $this->dsn;
Expand Down