Passed
Push — add-more-tests ( 2f4f47...85febb )
by Wilmer
24:26 queued 20:36
created

Dsn   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Db\Pgsql;
6
7
use Yiisoft\Db\Connection\AbstractDsn;
8
9
/**
10
 * The Dsn class is typically used to parse a DSN string, which is a string that contains all the necessary information
11
 * to connect to a database SQL Server, such as the database driver, host, database name, port, options.
12
 *
13
 * It also allows you to access individual components of the DSN, such as the driver, host, database name or port.
14
 *
15
 * @link https://www.php.net/manual/en/ref.pdo-pgsql.connection.php
16
 */
17
final class Dsn extends AbstractDsn
18
{
19
    /**
20
     * @psalm-param string[] $options
21
     */
22 655
    public function __construct(
23
        private string $driver,
24
        private string $host,
25
        private string $databaseName,
26
        private string $port = '5432',
27
        private array $options = []
28
    ) {
29 655
        parent::__construct($driver, $host, $databaseName, $port, $options);
30
    }
31
}
32