aboutsummaryrefslogtreecommitdiff
path: root/lib/Minz/Configuration.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2024-09-06 09:06:46 +0200
committerGravatar GitHub <noreply@github.com> 2024-09-06 09:06:46 +0200
commita81656c3ed5b8fe0f31794a4fbe0d1a907fca8e8 (patch)
tree8bf49bd876aaebc985a9fb1214863190a799cbee /lib/Minz/Configuration.php
parent8f7c3473a76809efc88814253722c76f0cc8eb04 (diff)
Upgrade to PHP 8.1 (#6711)
* Upgrade to PHP 8.1 As discussed in https://github.com/FreshRSS/FreshRSS/discussions/5474 https://www.php.net/releases/8.0/en.php https://www.php.net/releases/8.1/en.php Upgrade to available native type declarations https://php.net/language.types.declarations Upgrade to https://phpunit.de/announcements/phpunit-10.html which requires PHP 8.1+ (good timing, as version 9 was not maintained anymore) Upgrade `:oldest` Docker dev image to oldest Alpine version supporting PHP 8.1: Alpine 3.16, which includes PHP 8.1.22. * Include 6736 https://github.com/FreshRSS/FreshRSS/pull/6736
Diffstat (limited to 'lib/Minz/Configuration.php')
-rw-r--r--lib/Minz/Configuration.php12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/Minz/Configuration.php b/lib/Minz/Configuration.php
index 7205f3009..89aea4fae 100644
--- a/lib/Minz/Configuration.php
+++ b/lib/Minz/Configuration.php
@@ -56,10 +56,9 @@ class Minz_Configuration {
* Return the configuration related to a given namespace.
*
* @param string $namespace the name of the configuration to get.
- * @return static object
* @throws Minz_ConfigurationNamespaceException if the namespace does not exist.
*/
- public static function get(string $namespace) {
+ public static function get(string $namespace): static {
if (!isset(self::$config_list[$namespace])) {
throw new Minz_ConfigurationNamespaceException(
$namespace . ' namespace does not exist'
@@ -156,7 +155,7 @@ class Minz_Configuration {
* @param mixed $default default value to return if key does not exist.
* @return array|mixed value corresponding to the key.
*/
- public function param(string $key, $default = null) {
+ public function param(string $key, mixed $default = null): mixed {
if (isset($this->data[$key])) {
return $this->data[$key];
} elseif (!is_null($default)) {
@@ -171,7 +170,7 @@ class Minz_Configuration {
* A wrapper for param().
* @return array|mixed
*/
- public function __get(string $key) {
+ public function __get(string $key): mixed {
return $this->param($key);
}
@@ -181,7 +180,7 @@ class Minz_Configuration {
* @param string $key the param name to set.
* @param mixed $value the value to set. If null, the key is removed from the configuration.
*/
- public function _param(string $key, $value = null): void {
+ public function _param(string $key, mixed $value = null): void {
if ($this->configuration_setter !== null && $this->configuration_setter->support($key)) {
$this->configuration_setter->handle($this->data, $key, $value);
} elseif (isset($this->data[$key]) && is_null($value)) {
@@ -193,9 +192,8 @@ class Minz_Configuration {
/**
* A wrapper for _param().
- * @param mixed $value
*/
- public function __set(string $key, $value): void {
+ public function __set(string $key, mixed $value): void {
$this->_param($key, $value);
}