ConnectionConfig::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 3
dl 0
loc 6
ccs 0
cts 2
cp 0
crap 2
rs 10
c 1
b 0
f 0
1
<?php
2
3
/**
4
 * This file is part of Cycle Database package.
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
declare(strict_types=1);
11
12
namespace Cycle\Database\Config\SQLServer;
13
14
use Cycle\Database\Config\PDOConnectionConfig;
15
16
/**
17
 * @psalm-type IsolationLevelType = \PDO::SQLSRV_TXN_*
18
 *
19
 * @psalm-import-type PDOFlag from PDOConnectionConfig
20
 */
21
abstract class ConnectionConfig extends PDOConnectionConfig
22
{
23
    /**
24
     * General driver specific PDO options.
25
     *
26
     * @var array<PDOFlag, mixed>
27
     */
28
    protected const DEFAULT_PDO_OPTIONS = [
29
        \PDO::ATTR_CASE              => \PDO::CASE_NATURAL,
30
        \PDO::ATTR_ERRMODE           => \PDO::ERRMODE_EXCEPTION,
31
        \PDO::ATTR_STRINGIFY_FETCHES => false,
32
    ];
33
34
    /**
35
     * @param non-empty-string|null $user
0 ignored issues
show
Documentation Bug introduced by
The doc comment non-empty-string|null at position 0 could not be parsed: Unknown type name 'non-empty-string' at position 0 in non-empty-string|null.
Loading history...
36
     * @param non-empty-string|null $password
37
     */
38
    public function __construct(
39
        ?string $user = null,
40
        ?string $password = null,
41
        array $options = [],
42
    ) {
43
        parent::__construct($user, $password, $options);
44
    }
45
46
    public function getName(): string
47
    {
48
        return 'sqlsrv';
49 6
    }
50
}
51