aboutsummaryrefslogtreecommitdiff
path: root/lib/Minz
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2022-01-06 22:39:35 +0100
committerGravatar GitHub <noreply@github.com> 2022-01-06 22:39:35 +0100
commit8e398d24f132095fffba0db3c7ceea9a43371b4d (patch)
treeea40e91c9e55f590826dc6571f2a9a098431535c /lib/Minz
parentd339b6dd454d814ffc323fa9077b70e33339c479 (diff)
Fix several PHP8.1 warnings (#4123)
* Fix several PHP8.1 warnings Taking advantage of https://github.com/FreshRSS/FreshRSS/pull/4121 * Couple oh type hints missing * Compatibility PHP 7 * Fix variadic PHPDocs syntax
Diffstat (limited to 'lib/Minz')
-rw-r--r--lib/Minz/ExtensionManager.php2
-rw-r--r--lib/Minz/Migrator.php2
-rw-r--r--lib/Minz/Translate.php4
-rw-r--r--lib/Minz/Url.php2
4 files changed, 5 insertions, 5 deletions
diff --git a/lib/Minz/ExtensionManager.php b/lib/Minz/ExtensionManager.php
index 2b42708f8..cad408aed 100644
--- a/lib/Minz/ExtensionManager.php
+++ b/lib/Minz/ExtensionManager.php
@@ -295,7 +295,7 @@ class Minz_ExtensionManager {
* array keys.
*
* @param string $hook_name the hook to call.
- * @param mixed $args additional parameters (for signature, please see self::$hook_list).
+ * @param mixed ...$args additional parameters (for signature, please see self::$hook_list).
* @return mixed|null final result of the called hook.
*/
public static function callHook($hook_name, ...$args) {
diff --git a/lib/Minz/Migrator.php b/lib/Minz/Migrator.php
index 4d58a9bd3..71abbff3e 100644
--- a/lib/Minz/Migrator.php
+++ b/lib/Minz/Migrator.php
@@ -129,7 +129,7 @@ class Minz_Migrator
public function __construct($directory = null) {
$this->applied_versions = [];
- if (!is_dir($directory)) {
+ if ($directory == null || !is_dir($directory)) {
return;
}
diff --git a/lib/Minz/Translate.php b/lib/Minz/Translate.php
index 4b860259e..19a86a00e 100644
--- a/lib/Minz/Translate.php
+++ b/lib/Minz/Translate.php
@@ -179,7 +179,7 @@ class Minz_Translate {
/**
* Translate a key into its corresponding value based on selected language.
* @param string $key the key to translate.
- * @param mixed $args additional parameters for variable keys.
+ * @param mixed ...$args additional parameters for variable keys.
* @return string value corresponding to the key.
* If no value is found, return the key itself.
*/
@@ -247,7 +247,7 @@ class Minz_Translate {
/**
* Alias for Minz_Translate::t()
* @param string $key
- * @param mixed $args
+ * @param mixed ...$args
*/
function _t($key, ...$args) {
return Minz_Translate::t($key, ...$args);
diff --git a/lib/Minz/Url.php b/lib/Minz/Url.php
index 777962e25..0bbf28b0d 100644
--- a/lib/Minz/Url.php
+++ b/lib/Minz/Url.php
@@ -121,7 +121,7 @@ class Minz_Url {
/**
* @param string $controller
* @param string $action
- * @param string $args
+ * @param string ...$args
*/
function _url ($controller, $action, ...$args) {
$nb_args = count($args);