| Total Complexity | 5 |
| Total Lines | 81 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class SchemaManager |
||
| 9 | { |
||
| 10 | use OptionalConstructor; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * what engine should be used |
||
| 14 | */ |
||
| 15 | protected string $engine = 'memtx'; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * space name |
||
| 19 | */ |
||
| 20 | protected string $space = 'lock'; |
||
| 21 | |||
| 22 | 13 | public function validateOptions() |
|
| 23 | { |
||
| 24 | 13 | if ($this->engine == '') { |
|
| 25 | 1 | throw new InvalidArgumentException("Engine should be defined"); |
|
| 26 | } |
||
| 27 | 13 | if ($this->space == '') { |
|
| 28 | 1 | throw new InvalidArgumentException("Space should be defined"); |
|
| 29 | } |
||
| 30 | 13 | } |
|
| 31 | /** |
||
| 32 | * setup database schema |
||
| 33 | */ |
||
| 34 | 13 | public function setup() |
|
| 74 | ]); |
||
| 75 | 13 | } |
|
| 76 | |||
| 77 | /** |
||
| 78 | * rollback lock store schema |
||
| 79 | */ |
||
| 80 | 13 | public function tearDown() |
|
| 89 | 13 | } |
|
| 90 | } |
||
| 91 |