summaryrefslogtreecommitdiffstats
path: root/modules-available/baseconfig/page.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2023-11-14 14:47:55 +0100
committerSimon Rettberg2023-11-14 14:47:55 +0100
commit06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0 (patch)
tree7e5493b102074672d8cfd8fe1a61e49f080edbe8 /modules-available/baseconfig/page.inc.php
parentUpdate phpstorm config (diff)
downloadslx-admin-06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0.tar.gz
slx-admin-06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0.tar.xz
slx-admin-06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0.zip
Add function param/return types, fix a lot more phpstorm complaints
Diffstat (limited to 'modules-available/baseconfig/page.inc.php')
-rw-r--r--modules-available/baseconfig/page.inc.php14
1 files changed, 6 insertions, 8 deletions
diff --git a/modules-available/baseconfig/page.inc.php b/modules-available/baseconfig/page.inc.php
index 8a9a7534..5d684a8e 100644
--- a/modules-available/baseconfig/page.inc.php
+++ b/modules-available/baseconfig/page.inc.php
@@ -68,7 +68,7 @@ class Page_BaseConfig extends Page
if (isset($var['shadowed']))
continue;
$validator = $var['validator'];
- $displayValue = (isset($newValues[$key]) ? $newValues[$key] : '');
+ $displayValue = $newValues[$key] ?? '';
// Validate data first!
$mangledValue = Validator::validate($validator, $displayValue);
if ($mangledValue === false) {
@@ -101,7 +101,7 @@ class Page_BaseConfig extends Page
foreach ($this->categories as $catid => $val) {
Dashboard::addSubmenu(
'#category_' . $catid,
- Dictionary::translateFileModule($this->categories[$catid]['module'], 'config-variable-categories', $catid, true)
+ Dictionary::translateFileModule($this->categories[$catid]['module'], 'config-variable-categories', $catid)
);
}
}
@@ -153,7 +153,7 @@ class Page_BaseConfig extends Page
}
}
if (!isset($entry['shadows'])) {
- $entry['shadows'] = isset($var['shadows']) ? $var['shadows'] : null;
+ $entry['shadows'] = $var['shadows'] ?? null;
}
$entry += array(
'item' => $this->makeInput(
@@ -165,7 +165,7 @@ class Page_BaseConfig extends Page
),
'description' => Util::markup(Dictionary::translateFileModule($var['module'], 'config-variables', $key)),
'setting' => $key,
- 'tree' => isset($parents[$key]) ? $parents[$key] : false,
+ 'tree' => $parents[$key] ?? false,
);
}
unset($entry);
@@ -260,7 +260,7 @@ class Page_BaseConfig extends Page
$this->qry_extra = $hook;
}
- private function getPermissionLocationId()
+ private function getPermissionLocationId(): int
{
if (!isset($this->qry_extra['locationResolver']) || !isset($this->qry_extra['field_value']))
return 0;
@@ -280,10 +280,8 @@ class Page_BaseConfig extends Page
/**
* Create html snippet for setting, based on given validator
- * @param string $validator
- * @return boolean
*/
- private function makeInput($validator, $setting, $current, $shadows, $disabled)
+ private function makeInput(string $validator, string $setting, string $current, ?array $shadows, bool $disabled): string
{
/* for the html snippet we need: */
$args = array('class' => 'form-control', 'name' => "setting[$setting]", 'id' => $setting);