Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
38 | public function findBestMatchingVersion(array $versionList, $constraint) |
||
39 | { |
||
40 | // Let's sort versions in reverse order. |
||
41 | usort($versionList, "version_compare"); |
||
42 | $versionList = array_reverse($versionList); |
||
43 | |||
44 | // Now, let's find the best match. |
||
45 | foreach ($versionList as $version) { |
||
46 | if ($this->isVersionMatching($version, $constraint)) { |
||
47 | return $version; |
||
48 | } |
||
49 | } |
||
50 | |||
51 | return; |
||
52 | } |
||
53 | } |
||
54 |