Total Complexity | 3 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Coverage | 50% |
Changes | 0 |
1 | <?php |
||
15 | class Driver extends AbstractOracleDriver |
||
16 | { |
||
17 | /** |
||
18 | * {@inheritdoc} |
||
19 | */ |
||
20 | 30 | public function connect( |
|
21 | array $params, |
||
22 | string $username = '', |
||
23 | string $password = '', |
||
24 | array $driverOptions = [] |
||
25 | ) : Connection { |
||
26 | try { |
||
27 | 30 | return new OCI8Connection( |
|
28 | 30 | $username, |
|
29 | $password, |
||
30 | 30 | $this->_constructDsn($params), |
|
31 | 30 | $params['charset'] ?? '', |
|
32 | 30 | $params['sessionMode'] ?? OCI_DEFAULT, |
|
33 | 30 | $params['persistent'] ?? false |
|
34 | ); |
||
35 | 3 | } catch (OCI8Exception $e) { |
|
36 | 3 | throw DBALException::driverException($this, $e); |
|
37 | } |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * Constructs the Oracle DSN. |
||
42 | * |
||
43 | * @param mixed[] $params |
||
44 | * |
||
45 | * @return string The DSN. |
||
46 | */ |
||
47 | 30 | protected function _constructDsn(array $params) : string |
|
50 | } |
||
51 | } |
||
52 |