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