Dsn   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 1 Features 1
Metric Value
eloc 4
c 1
b 1
f 1
dl 0
loc 17
ccs 4
cts 4
cp 1
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Db\Pgsql;
6
7
use Yiisoft\Db\Connection\AbstractDsn;
8
9
/**
10
 * Implement a Data Source Name (DSN) for a PostgreSQL Server.
11
 *
12
 * @link https://www.php.net/manual/en/ref.pdo-pgsql.connection.php
13
 */
14
final class Dsn extends AbstractDsn
15
{
16
    /**
17
     * @psalm-param string[] $options
18
     */
19 764
    public function __construct(
20
        string $driver,
21
        string $host,
22
        string|null $databaseName = 'postgres',
23
        string $port = '5432',
24
        array $options = []
25
    ) {
26 764
        if (empty($databaseName)) {
27 2
            $databaseName = 'postgres';
28
        }
29
30 764
        parent::__construct($driver, $host, $databaseName, $port, $options);
31
    }
32
}
33