| Total Complexity | 3 |
| Total Lines | 47 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | abstract class AbstractQueueStoreConnection |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var mixed the internal connection instance (ie. PDO) |
||
| 11 | */ |
||
| 12 | protected $instance; |
||
| 13 | /** |
||
| 14 | * @var array |
||
| 15 | */ |
||
| 16 | protected $configuration = []; |
||
| 17 | /** |
||
| 18 | * AbstractQueueStoreConnection constructor. |
||
| 19 | * |
||
| 20 | * @param array $configuration |
||
| 21 | */ |
||
| 22 | 12 | protected function __construct(array $configuration = []) |
|
| 23 | { |
||
| 24 | 12 | $this->configuration = $configuration; |
|
| 25 | 12 | } |
|
| 26 | |||
| 27 | /** |
||
| 28 | * @param $key |
||
| 29 | * @param null $default |
||
|
|
|||
| 30 | * |
||
| 31 | * @return mixed |
||
| 32 | */ |
||
| 33 | 13 | protected function getConfigurationValue($key, $default = null) |
|
| 34 | { |
||
| 35 | 13 | return ArrayHelper::getValue($this->configuration, $key, $default); |
|
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Disconnects previous connection. |
||
| 40 | */ |
||
| 41 | 11 | public function disconnect() |
|
| 44 | 11 | } |
|
| 45 | |||
| 46 | /** |
||
| 47 | * @return AbstractQueueStoreConnection |
||
| 48 | */ |
||
| 49 | abstract public function connect(); |
||
| 50 | /** |
||
| 51 | * @return mixed |
||
| 52 | */ |
||
| 53 | abstract public function getInstance(); |
||
| 54 | } |
||
| 55 |