From 783514eb44edcc09426168dade3fb4e5beedf65f Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Thu, 16 Mar 2023 22:58:06 +0100 Subject: [PATCH] cosmetic (type hint) --- src/My.php | 2 +- src/TranslaterLang.php | 4 ++-- src/TranslaterModule.php | 8 ++++---- src/Uninstall.php | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/My.php b/src/My.php index 3ca3186..b942f02 100644 --- a/src/My.php +++ b/src/My.php @@ -57,7 +57,7 @@ class My /** * List of possible home tab of the plugin */ - public static function startPageCombo() + public static function startPageCombo(): array { return [ __('Plugins') => 'plugin', diff --git a/src/TranslaterLang.php b/src/TranslaterLang.php index c4b9f4f..8cec16c 100644 --- a/src/TranslaterLang.php +++ b/src/TranslaterLang.php @@ -44,7 +44,7 @@ class TranslaterLang * @param string $key The lang property key * @return mixed The lang property value or null */ - public function get(string $key) + public function get(string $key): mixed { return array_key_exists($key, $this->prop) ? $this->prop[$key] : null; } @@ -52,7 +52,7 @@ class TranslaterLang /** * Magic get */ - public function __get($key) + public function __get(string $key): mixed { return $this->get($key); } diff --git a/src/TranslaterModule.php b/src/TranslaterModule.php index 728b2d5..e3d5d63 100644 --- a/src/TranslaterModule.php +++ b/src/TranslaterModule.php @@ -54,7 +54,7 @@ class TranslaterModule * @param string $key The module property key * @return mixed The module property value or null */ - public function get(string $key) + public function get(string $key): mixed { return array_key_exists($key, $this->prop) ? $this->prop[$key] : null; } @@ -62,7 +62,7 @@ class TranslaterModule /** * Magic get */ - public function __get($key) + public function __get(string $key): mixed { return $this->get($key); } @@ -73,9 +73,9 @@ class TranslaterModule * Find backup folder of a module * * @param boolean $throw Silently failed - * @return mixed The backup folder directory or false + * @return string|false The backup folder directory or false */ - public function getBackupRoot(bool $throw = false) + public function getBackupRoot(bool $throw = false): string|false { $dir = false; switch ($this->translater->backup_folder) { diff --git a/src/Uninstall.php b/src/Uninstall.php index 1098941..c9a4007 100644 --- a/src/Uninstall.php +++ b/src/Uninstall.php @@ -16,7 +16,7 @@ namespace Dotclear\Plugin\translater; class Uninstall { - protected static $init = false; + protected static bool $init = false; public static function init(): bool {