Skip to content

Commit 1cf5233

Browse files
committed
Sort builds in descending order in pre-release-builds
1 parent 2fc9be2 commit 1cf5233

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

pre-release-builds.php

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,15 @@
7777

7878
<h2 id="source">Source Builds</h2>
7979
<?php if (!empty($QA_RELEASES['releases'])) : ?>
80-
<?php $plural = count($QA_RELEASES['releases']) > 1 ? 's' : ''; ?>
81-
82-
<?php foreach ($QA_RELEASES['releases'] as $pversion => $info) : ?>
80+
<?php
81+
$sourceReleases = $QA_RELEASES['releases'];
82+
uksort($sourceReleases, static function ($a, $b) {
83+
return version_compare($b, $a);
84+
});
85+
$plural = count($sourceReleases) > 1 ? 's' : '';
86+
?>
87+
88+
<?php foreach ($sourceReleases as $pversion => $info) : ?>
8389
<h3 class="title">
8490
PHP <?php echo $info['version']; ?>
8591
</h3>
@@ -258,6 +264,11 @@
258264
'builds' => $builds,
259265
];
260266
}
267+
if (!empty($winQaReleases)) {
268+
usort($winQaReleases, static function ($a, $b) {
269+
return version_compare($b['version_label'], $a['version_label']);
270+
});
271+
}
261272
} else {
262273
$winQaMessage = 'Windows QA release index could not be parsed.';
263274
}

0 commit comments

Comments
 (0)