AbstractConnectionConfig   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 78
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 16
c 1
b 0
f 0
dl 0
loc 78
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getPassword() 0 3 1
A getUsername() 0 3 1
A getDbname() 0 3 1
A __construct() 0 14 1
1
<?php declare(strict_types=1);
2
3
namespace Janisbiz\LightOrm\Connection;
4
5
abstract class AbstractConnectionConfig implements ConnectionConfigInterface
6
{
7
    /**
8
     * @var string
9
     */
10
    protected $host;
11
12
    /**
13
     * @var string
14
     */
15
    protected $username;
16
17
    /**
18
     * @var string
19
     */
20
    protected $password;
21
22
    /**
23
     * @var string
24
     */
25
    protected $dbname;
26
27
    /**
28
     * @var string
29
     */
30
    protected $adapter;
31
32
    /**
33
     * @var int
34
     */
35
    protected $port;
36
37
    /**
38
     * @param string $host
39
     * @param string $username
40
     * @param string $password
41
     * @param string $dbname
42
     * @param string $adapter
43
     * @param int $port
44
     */
45
    public function __construct(
46
        string $host,
47
        string $username,
48
        string $password,
49
        string $dbname,
50
        string $adapter,
51
        int $port = 3306
52
    ) {
53
        $this->host = $host;
54
        $this->username = $username;
55
        $this->password = $password;
56
        $this->dbname = $dbname;
57
        $this->adapter = $adapter;
58
        $this->port = $port;
59
    }
60
61
    /**
62
     * @return string
63
     */
64
    public function getUsername(): string
65
    {
66
        return $this->username;
67
    }
68
69
    /**
70
     * @return string
71
     */
72
    public function getPassword(): string
73
    {
74
        return $this->password;
75
    }
76
77
    /**
78
     * @return string
79
     */
80
    public function getDbname(): string
81
    {
82
        return $this->dbname;
83
    }
84
}
85