| Total Complexity | 7 |
| Total Lines | 80 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 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 |
||
| 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 |
||
| 88 | } |
||
| 89 | } |
||
| 90 |