OracleHelper   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 1
eloc 9
c 1
b 1
f 0
dl 0
loc 14
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A createConnection() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\ActiveRecord\Tests\Support;
6
7
use PDO;
8
use Yiisoft\Db\Connection\ConnectionInterface;
9
use Yiisoft\Db\Oracle\Connection;
10
use Yiisoft\Db\Oracle\Driver;
11
12
final class OracleHelper extends ConnectionHelper
13
{
14
    private string $dsn = 'oci:dbname=localhost/XE;';
15
    private string $username = 'system';
16
    private string $password = 'root';
17
    private string $charset = 'AL32UTF8';
18
19
    public function createConnection(): ConnectionInterface
20
    {
21
        $pdoDriver = new Driver($this->dsn, $this->username, $this->password);
22
        $pdoDriver->charset($this->charset);
23
        $pdoDriver->attributes([PDO::ATTR_STRINGIFY_FETCHES => true]);
24
25
        return new Connection($pdoDriver, $this->createSchemaCache());
26
    }
27
}
28