Total Complexity | 2 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Changes | 4 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | final class PickLastMinorVersionFromCollection implements PickVersionFromVersionCollection |
||
17 | { |
||
18 | /** |
||
19 | * {@inheritDoc} |
||
20 | * |
||
21 | * @throws LogicException |
||
22 | * @throws RuntimeException |
||
23 | */ |
||
24 | public function forVersions(VersionCollection $versions) : Version |
||
25 | { |
||
26 | Assert::that($versions->count()) |
||
27 | ->greaterThan(0, 'Cannot determine latest minor version from an empty collection'); |
||
28 | |||
29 | $stableVersions = $versions->matching(new class implements Constraint { |
||
30 | public function assert(Version $version) : bool |
||
48 | } |
||
49 | } |
||
50 |