From a81656c3ed5b8fe0f31794a4fbe0d1a907fca8e8 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 6 Sep 2024 09:06:46 +0200 Subject: 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 --- app/Utils/dotNotationUtil.php | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'app/Utils/dotNotationUtil.php') diff --git a/app/Utils/dotNotationUtil.php b/app/Utils/dotNotationUtil.php index 9c44e5312..73addbe74 100644 --- a/app/Utils/dotNotationUtil.php +++ b/app/Utils/dotNotationUtil.php @@ -12,11 +12,8 @@ final class FreshRSS_dotNotation_Util * https://github.com/laravel/framework/blob/10.x/src/Illuminate/Collections/Arr.php#L302-L337 * * @param \ArrayAccess|array|mixed $array - * @param string|null $key - * @param mixed $default - * @return mixed */ - public static function get($array, ?string $key, mixed $default = null) { + public static function get($array, ?string $key, mixed $default = null): mixed { if (!static::accessible($array)) { return static::value($default); } @@ -51,7 +48,6 @@ final class FreshRSS_dotNotation_Util * Get a string from an array using "dot" notation. * * @param \ArrayAccess|array|mixed $array - * @param string|null $key */ public static function getString($array, ?string $key): ?string { $result = self::get($array, $key, null); @@ -60,11 +56,8 @@ final class FreshRSS_dotNotation_Util /** * Determine whether the given value is array accessible. - * - * @param mixed $value - * @return bool */ - private static function accessible($value): bool { + private static function accessible(mixed $value): bool { return is_array($value) || $value instanceof \ArrayAccess; } @@ -72,8 +65,6 @@ final class FreshRSS_dotNotation_Util * Determine if the given key exists in the provided array. * * @param \ArrayAccess|array|mixed $array - * @param string $key - * @return bool */ private static function exists($array, string $key): bool { if ($array instanceof \ArrayAccess) { @@ -85,8 +76,7 @@ final class FreshRSS_dotNotation_Util return false; } - /** @param mixed $value */ - private static function value($value): mixed { + private static function value(mixed $value): mixed { return $value instanceof Closure ? $value() : $value; } -- cgit v1.2.3