Skip to content

Commit 2fa7641

Browse files
committed
nits
1 parent 23b1eb6 commit 2fa7641

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

downloads.php

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ function option(string $value, string $desc, $attributes = []): string
4545

4646
$usage = [
4747
'web' => 'Web Development',
48-
'cli' => 'Command Line Libraries',
49-
'fw-drupal' => 'Drupal',
50-
'fw-laravel' => 'Laravel',
51-
'fw-symfony' => 'Symfony',
48+
'cli' => 'CLI/Library Development',
49+
'fw-drupal' => 'Drupal Development',
50+
'fw-laravel' => 'Laravel Development',
51+
'fw-symfony' => 'Symfony Development',
52+
'fw-wordpress' => 'WordPress Development',
5253
];
5354

5455
$os = [
@@ -78,6 +79,14 @@ function option(string $value, string $desc, $attributes = []): string
7879
],
7980
];
8081

82+
$versions = [
83+
'php84' => 'version 8.4',
84+
'php83' => 'version 8.3',
85+
'php82' => 'version 8.2',
86+
'php81' => 'version 8.1',
87+
'default' => 'OS default version',
88+
];
89+
8190
$defaults = [
8291
'os' => 'linux',
8392
'version' => 'php84',
@@ -124,11 +133,11 @@ function option(string $value, string $desc, $attributes = []): string
124133
<?php } ?>,
125134
and use
126135
<select id="version" name="version">
127-
<?= option('php84', 'version 8.4'); ?>
128-
<?= option('php83', 'version 8.3'); ?>
129-
<?= option('php82', 'version 8.2'); ?>
130-
<?= option('php81', 'version 8.1'); ?>
131-
<?= option('default', 'OS default version'); ?>
136+
<?php foreach ($versions as $value => $version) { ?>
137+
<?= option($value, $version, [
138+
'selected' => array_key_exists('version', $options) && $options['version'] === $value,
139+
]); ?>
140+
<?php } ?>
132141
</select>
133142
</div>
134143

0 commit comments

Comments
 (0)