summaryrefslogtreecommitdiffstats
path: root/modules-available/sysconfig/inc/configmodule/customodule.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/sysconfig/inc/configmodule/customodule.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/sysconfig/inc/configmodule/customodule.inc.php')
-rw-r--r--modules-available/sysconfig/inc/configmodule/customodule.inc.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/modules-available/sysconfig/inc/configmodule/customodule.inc.php b/modules-available/sysconfig/inc/configmodule/customodule.inc.php
index 56aa9277..b5c10104 100644
--- a/modules-available/sysconfig/inc/configmodule/customodule.inc.php
+++ b/modules-available/sysconfig/inc/configmodule/customodule.inc.php
@@ -16,12 +16,12 @@ class ConfigModule_CustomModule extends ConfigModule
private $tmpFile = false;
- protected function generateInternal($tgz, $parent)
+ protected function generateInternal(string $tgz, ?string $parent)
{
if (!$this->validateConfig()) {
// No temp file given from wizard
// Old archive still exists? pretend it worked...
- if ($this->archive() === false || !file_exists($this->archive()))
+ if ($this->archive() === '' || !file_exists($this->archive()))
return false;
if ($this->currentVersion() == 1) {
// Need an upgrade
@@ -42,17 +42,17 @@ class ConfigModule_CustomModule extends ConfigModule
));
}
- protected function moduleVersion()
+ protected function moduleVersion(): int
{
return self::VERSION;
}
- protected function validateConfig()
+ protected function validateConfig(): bool
{
return $this->tmpFile !== false && file_exists($this->tmpFile);
}
- public function setData($key, $value)
+ public function setData(string $key, $value): bool
{
// Sets the temp file from the wizard, where it stored the processed archive
if ($key !== 'tmpFile' || !file_exists($value))
@@ -61,12 +61,12 @@ class ConfigModule_CustomModule extends ConfigModule
return true;
}
- public function getData($key)
+ public function getData(?string $key): bool
{
return false;
}
- public function allowDownload()
+ public function allowDownload(): bool
{
return true;
}