RetryDriver   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A connect() 0 3 1
1
<?php
2
3
namespace Ez\DbLinker\Driver;
4
5
use Ez\DbLinker\Driver\Connection\RetryConnection;
6
7
trait RetryDriver
8
{
9
    /**
10
     * Attempts to create a connection with the database.
11
     *
12
     * @param array       $params        All connection parameters passed by the user.
13
     * @param string|null $username      The username to use when connecting.
14
     * @param string|null $password      The password to use when connecting.
15
     * @param array       $driverOptions The driver options to use when connecting.
16
     *
17
     * @return \Doctrine\DBAL\Driver\Connection The database connection.
18
     */
19
    public function connect(Array $params, $username = null, $password = null, Array $driverOptions = []) {
20
        return new RetryConnection($params['connectionParams'], $params['retryStrategy']);
21
    }
22
}
23