Passed
Push — master ( 8a002b...c640bb )
by Wilmer
05:52 queued 01:51
created

Driver   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 11
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createConnection() 0 4 1
A getDriverName() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Db\Mssql;
6
7
use PDO;
8
use Yiisoft\Db\Driver\PDO\AbstractPDODriver;
9
10
/**
11
 * Implements the MSSQL Server driver based on the PDO (PHP Data Objects) extension.
12
 *
13
 * @link https://www.php.net/manual/en/ref.pdo-sqlsrv.php
14
 */
15
final class Driver extends AbstractPDODriver
16
{
17 632
    public function createConnection(): PDO
18
    {
19 632
        $this->attributes += [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION];
20 632
        return parent::createConnection();
21
    }
22
23 566
    public function getDriverName(): string
24
    {
25 566
        return 'sqlsrv';
26
    }
27
}
28