RetryDriver::connect()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 4
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