diff options
Diffstat (limited to 'modules-available/sysconfig/inc/configmodule/customodule.inc.php')
-rw-r--r-- | modules-available/sysconfig/inc/configmodule/customodule.inc.php | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/modules-available/sysconfig/inc/configmodule/customodule.inc.php b/modules-available/sysconfig/inc/configmodule/customodule.inc.php index 8b968336..0b8e38d2 100644 --- a/modules-available/sysconfig/inc/configmodule/customodule.inc.php +++ b/modules-available/sysconfig/inc/configmodule/customodule.inc.php @@ -13,15 +13,16 @@ class ConfigModule_CustomModule extends ConfigModule { const MODID = 'CustomModule'; const VERSION = 2; - + + /** @var false|string */ 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 @@ -34,26 +35,25 @@ class ConfigModule_CustomModule extends ConfigModule // Nothing to do return true; } - $task = Taskmanager::submit('MoveFile', array( + return Taskmanager::submit('MoveFile', array( 'source' => $this->tmpFile, 'destination' => $tgz, 'parentTask' => $parent, 'failOnParentFail' => false )); - return $task; } - 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)) @@ -62,12 +62,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; } |