From 06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 14 Nov 2023 14:47:55 +0100 Subject: Add function param/return types, fix a lot more phpstorm complaints --- .../sysconfig/inc/configmodule/customodule.inc.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'modules-available/sysconfig/inc/configmodule/customodule.inc.php') 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; } -- cgit v1.2.3-55-g7522