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 | 17 | public function validateOptions() |
|
23 | { |
||
24 | 17 | if ($this->engine == '') { |
|
25 | 1 | throw new InvalidArgumentException("Engine should be defined"); |
|
26 | } |
||
27 | 17 | if ($this->space == '') { |
|
28 | 1 | throw new InvalidArgumentException("Space should be defined"); |
|
29 | } |
||
30 | 17 | } |
|
31 | /** |
||
32 | * setup database schema |
||
33 | */ |
||
34 | 17 | public function setup() |
|
74 | ]); |
||
75 | 17 | } |
|
76 | |||
77 | /** |
||
78 | * rollback lock store schema |
||
79 | */ |
||
80 | 17 | public function tearDown() |
|
89 | 17 | } |
|
90 | } |
||
91 |