Completed
Push — master ( 670622...a5ffbc )
by Edson
01:42
created

Driver   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 49
ccs 0
cts 31
cp 0
rs 10
c 0
b 0
f 0
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A setPass() 0 3 1
A setPort() 0 3 1
A setUser() 0 3 1
A getPass() 0 3 1
A setDbname() 0 3 1
A getUser() 0 3 1
A setCharset() 0 3 1
A setHost() 0 3 1
1
<?php
2
3
namespace Keep;
4
5
abstract class Driver
6
{
7
    protected $host;
8
    protected $port = 80;
9
    protected $dbname;
10
    protected $user;
11
    protected $pass;
12
    protected $charset = 'utf8';
13
14
    abstract public function getDsn(): string;
15
16
    public function getUser(): string
17
    {
18
        return $this->user;
19
    }
20
21
    public function getPass(): string
22
    {
23
        return $this->pass;
24
    }
25
26
    public function setHost(string $host): void
27
    {
28
        $this->host = $host;
29
    }
30
31
    public function setPort(int $port): void
32
    {
33
        $this->port = $port;
34
    }
35
36
    public function setDbname(string $dbname): void
37
    {
38
        $this->dbname = $dbname;
39
    }
40
41
    public function setUser(string $user): void
42
    {
43
        $this->user = $user;
44
    }
45
46
    public function setPass(string $pass): void
47
    {
48
        $this->pass = $pass;
49
    }
50
51
    public function setCharset(string $charset): void
52
    {
53
        $this->charset = $charset;
54
    }
55
}
56