| Total Complexity | 8 |
| Total Lines | 49 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 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 |
||
| 49 | } |
||
| 50 | |||
| 51 | public function setCharset(string $charset): void |
||
| 52 | { |
||
| 53 | $this->charset = $charset; |
||
| 54 | } |
||
| 55 | } |
||
| 56 |