Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3.576 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
39 | 2 | public function rollup() : Version |
|
40 | { |
||
41 | 2 | $versions = $this->migrationRepository->getMigrations(); |
|
42 | |||
43 | 2 | if (count($versions) === 0) { |
|
44 | 1 | throw RollupFailed::noMigrationsFound(); |
|
45 | } |
||
46 | |||
47 | 1 | if (count($versions) > 1) { |
|
48 | 1 | throw RollupFailed::tooManyMigrations(); |
|
49 | } |
||
50 | |||
51 | $this->metadataStorage->reset(); |
||
52 | |||
53 | $result = new ExecutionResult(reset($versions->getItems())->getVersion()); |
||
54 | $this->metadataStorage->complete($result); |
||
55 | |||
56 | return $result->getVersion(); |
||
57 | } |
||
59 |