Passed
Branch master (f36b3c)
by Matthew
08:01
created

Driver   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
eloc 7
c 2
b 0
f 0
dl 0
loc 17
ccs 6
cts 6
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getOptions() 0 7 3
1
<?php
2
namespace Fyuze\Database\Drivers;
3
4
use PDO;
5
6
abstract class Driver implements ConnectionInterface
7
{
8
    /**
9
     * @var array
10
     */
11
    protected $config;
12
13
    /**
14
     * @return array
15
     */
16 6
    protected function getOptions()
17
    {
18 6
        return [
19 6
            PDO::ATTR_PERSISTENT => array_key_exists('persistent', $this->config) ? $this->config['persistent'] : false,
20 6
            PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
21 6
            PDO::ATTR_DEFAULT_FETCH_MODE => array_key_exists('fetch', $this->config)
22 6
                ? constant($this->config['fetch']) : PDO::FETCH_OBJ
23 6
        ];
24
    }
25
}
26