Passed
Push — master ( 15d64f...e25937 )
by Jean Paul
01:30
created

Connector::getDbName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Coco\SourceWatcher\Core\Database\Connections;
4
5
use Doctrine\DBAL\Connection;
6
7
abstract class Connector
8
{
9
    protected string $driver;
10
    protected array $connectionParameters = [];
11
12
    protected string $user;
13
    protected string $password;
14
    protected string $host;
15
    protected int $port;
16
    protected string $dbName;
17
18
    public abstract function connect () : Connection;
19
20
    /**
21
     * @return string
22
     */
23
    public function getDriver () : string
24
    {
25
        return $this->driver;
26
    }
27
28
    protected abstract function getConnectionParameters () : array;
29
30
    /**
31
     * @return string
32
     */
33
    public function getUser () : string
34
    {
35
        return $this->user;
36
    }
37
38
    /**
39
     * @param string $user
40
     */
41
    public function setUser ( string $user ) : void
42
    {
43
        $this->user = $user;
44
    }
45
46
    /**
47
     * @return string
48
     */
49
    public function getPassword () : string
50
    {
51
        return $this->password;
52
    }
53
54
    /**
55
     * @param string $password
56
     */
57
    public function setPassword ( string $password ) : void
58
    {
59
        $this->password = $password;
60
    }
61
62
    /**
63
     * @return string
64
     */
65
    public function getHost () : string
66
    {
67
        return $this->host;
68
    }
69
70
    /**
71
     * @param string $host
72
     */
73
    public function setHost ( string $host ) : void
74
    {
75
        $this->host = $host;
76
    }
77
78
    /**
79
     * @return int
80
     */
81
    public function getPort () : int
82
    {
83
        return $this->port;
84
    }
85
86
    /**
87
     * @param int $port
88
     */
89
    public function setPort ( int $port ) : void
90
    {
91
        $this->port = $port;
92
    }
93
94
    /**
95
     * @return string
96
     */
97
    public function getDbName () : string
98
    {
99
        return $this->dbName;
100
    }
101
102
    /**
103
     * @param string $dbName
104
     */
105
    public function setDbName ( string $dbName ) : void
106
    {
107
        $this->dbName = $dbName;
108
    }
109
}
110