Failed Conditions
Pull Request — master (#3821)
by
unknown
08:14
created

Driver::connect()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2.864

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 10
ccs 4
cts 10
cp 0.4
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 4
crap 2.864
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\DBAL\Driver\Mysqli;
6
7
use Doctrine\DBAL\DBALException;
8
use Doctrine\DBAL\Driver\AbstractMySQLDriver;
9
use Doctrine\DBAL\Driver\Connection;
10
11
final class Driver extends AbstractMySQLDriver
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16 334
    public function connect(
17
        array $params,
18
        string $username = '',
19
        string $password = '',
20
        array $driverOptions = []
21
    ) : Connection {
22
        try {
23 334
            return new MysqliConnection($params, $username, $password, $driverOptions);
24 30
        } catch (MysqliException $e) {
25 30
            throw DBALException::driverException($this, $e);
26
        }
27
    }
28
}
29