summaryrefslogtreecommitdiffstats
path: root/includes/view-helpers/select_field.php
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2022-06-18 11:38:26 +0200
committerHarald Eilertsen <haraldei@anduin.net>2022-06-18 11:38:26 +0200
commit0e42a12a33b9bb193fa7851628edf018bd922362 (patch)
treef01c0f82d0d8399f9c502d769c8e182e3b6df153 /includes/view-helpers/select_field.php
parentc0ff4d1d2ca7e4226d718bf11a636f431c470fe6 (diff)
downloadgigologadmin-0e42a12a33b9bb193fa7851628edf018bd922362.tar.gz
gigologadmin-0e42a12a33b9bb193fa7851628edf018bd922362.tar.bz2
gigologadmin-0e42a12a33b9bb193fa7851628edf018bd922362.zip
Add phpcs config and do automatic fixups.
Diffstat (limited to 'includes/view-helpers/select_field.php')
-rw-r--r--includes/view-helpers/select_field.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/includes/view-helpers/select_field.php b/includes/view-helpers/select_field.php
index e72fc40..aa156d0 100644
--- a/includes/view-helpers/select_field.php
+++ b/includes/view-helpers/select_field.php
@@ -19,13 +19,12 @@ namespace EternalTerror\ViewHelpers;
*/
function select_field(
string $name,
- array $opts = [],
+ array $opts = array(),
$selected = null,
- string $blank = "Please select...") : string
-{
+ string $blank = 'Please select...' ) : string {
$body = "<option value=\"\">{$blank}</option>";
- foreach ($opts as $opt) {
- $sel = selected($selected, $opt[0], false);
+ foreach ( $opts as $opt ) {
+ $sel = selected( $selected, $opt[0], false );
$body .= "<option value=\"{$opt[0]}\"{$sel}>{$opt[1]}</option>";
}
return "<select name=\"{$name}\">{$body}</select>";