Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | public function fromRepository(CheckedOutRepository $checkedOutRepository) : VersionsCollection |
||
18 | { |
||
19 | $output = (new Process(['git', 'tag', '-l'])) |
||
20 | ->setWorkingDirectory((string)$checkedOutRepository) |
||
21 | ->mustRun() |
||
22 | ->getOutput(); |
||
23 | |||
24 | // @todo handle invalid versions more gracefully (drop them) |
||
25 | return VersionsCollection::fromArray(array_filter( |
||
26 | explode("\n", $output), |
||
27 | function (string $maybeVersion) { |
||
28 | return trim($maybeVersion) !== ''; |
||
29 | } |
||
33 |