| Total Complexity | 3 |
| Total Lines | 56 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 2 |
| 1 | <?php |
||
| 19 | abstract class AbstractStorageFactory |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * @var string One of supported drivers |
||
| 23 | */ |
||
| 24 | protected string $driver = ''; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var array<string> Factory supported driver |
||
| 28 | */ |
||
| 29 | protected array $supportedDriver = []; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @var array<mixed> Options for the driver |
||
| 33 | */ |
||
| 34 | protected array $options = []; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Constructor. |
||
| 38 | * |
||
| 39 | * @param string $driver |
||
| 40 | * @param array<mixed> $options |
||
| 41 | */ |
||
| 42 | 22 | public function __construct(string $driver, array $options) |
|
| 46 | 22 | } |
|
| 47 | |||
| 48 | /** |
||
| 49 | * Return Storage Object. |
||
| 50 | * |
||
| 51 | * @throws InvalidArgumentException If required driver is not supported |
||
| 52 | * |
||
| 53 | * @return mixed |
||
| 54 | */ |
||
| 55 | 22 | protected function returnStorageObject() |
|
| 67 | } |
||
| 68 | |||
| 69 | /** |
||
| 70 | * Get storage object. |
||
| 71 | * |
||
| 72 | * @return mixed |
||
| 73 | */ |
||
| 74 | abstract public function get(); |
||
| 75 | } |
||
| 76 |