Driver   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 1
dl 0
loc 23
c 0
b 0
f 0
ccs 0
cts 5
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A connect() 0 6 1
1
<?php
2
3
namespace Adgoal\DBALFaultTolerance\Driver\Mysqli;
4
5
use Adgoal\DBALFaultTolerance\Driver\DriverInterface;
6
use Adgoal\DBALFaultTolerance\Driver\ServerGoneAwayExceptionsAwareTrait;
7
use Doctrine\DBAL\DBALException;
8
9
/**
10
 * Class Driver.
11
 */
12
class Driver extends \Doctrine\DBAL\Driver\Mysqli\Driver implements DriverInterface
13
{
14
    use ServerGoneAwayExceptionsAwareTrait;
15
16
    /**
17
     * @var array
18
     */
19
    private $extendedDriverOptions = [
20
        'x_reconnect_attempts',
21
    ];
22
23
    /**
24
     * {@inheritdoc}
25
     *
26
     * @throws DBALException
27
     */
28
    public function connect(array $params, $username = null, $password = null, array $driverOptions = [])
29
    {
30
        $driverOptions = array_diff_key($driverOptions, array_flip($this->extendedDriverOptions));
31
32
        return parent::connect($params, $username, $password, $driverOptions);
33
    }
34
}
35