| Conditions | 2 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 27 | public function fromRepository(CheckedOutRepository $checkedOutRepository) : VersionCollection |
||
| 28 | { |
||
| 29 | $output = (new Process(['git', 'tag', '-l'])) |
||
| 30 | ->setWorkingDirectory($checkedOutRepository->__toString()) |
||
| 31 | ->mustRun() |
||
| 32 | ->getOutput(); |
||
| 33 | |||
| 34 | return new VersionCollection(...array_filter( |
||
| 35 | array_map(static function (string $maybeVersion) : ?Version { |
||
| 36 | try { |
||
| 37 | return Version::fromString($maybeVersion); |
||
| 38 | } catch (InvalidVersionString $e) { |
||
| 39 | return null; |
||
| 40 | } |
||
| 41 | }, explode("\n", $output)) |
||
| 42 | )); |
||
| 45 |