Passed
Push — master ( 246131...dcc761 )
by Jean Paul
01:17
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 Coco\SourceWatcher\Core\Row;
6
use Doctrine\DBAL\Connection;
7
8
abstract class Connector
9
{
10
    protected string $driver = "";
11
12
    protected array $connectionParameters = [];
13
14
    protected string $user = "";
15
    protected string $password = "";
16
17
    protected string $tableName = "";
18
19
    /**
20
     * @return Connection
21
     */
22
    public abstract function connect () : Connection;
23
24
    /**
25
     * @param Row $row
26
     */
27
    public abstract function insert ( Row $row ) : void;
28
29
    /**
30
     * @return string
31
     */
32
    public function getDriver () : string
33
    {
34
        return $this->driver;
35
    }
36
37
    /**
38
     * @return array
39
     */
40
    protected abstract function getConnectionParameters () : array;
41
42
    /**
43
     * @return string
44
     */
45
    public function getUser () : string
46
    {
47
        return $this->user;
48
    }
49
50
    /**
51
     * @param string $user
52
     */
53
    public function setUser ( string $user ) : void
54
    {
55
        $this->user = $user;
56
    }
57
58
    /**
59
     * @return string
60
     */
61
    public function getPassword () : string
62
    {
63
        return $this->password;
64
    }
65
66
    /**
67
     * @param string $password
68
     */
69
    public function setPassword ( string $password ) : void
70
    {
71
        $this->password = $password;
72
    }
73
74
    /**
75
     * @return string
76
     */
77
    public function getTableName () : string
78
    {
79
        return $this->tableName;
80
    }
81
82
    /**
83
     * @param string $tableName
84
     */
85
    public function setTableName ( string $tableName ) : void
86
    {
87
        $this->tableName = $tableName;
88
    }
89
}
90