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

Driver   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 40%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A connect() 0 10 2
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