aboutsummaryrefslogtreecommitdiff
path: root/app/Utils/dotNotationUtil.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 /app/Utils/dotNotationUtil.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 'app/Utils/dotNotationUtil.php')
-rw-r--r--app/Utils/dotNotationUtil.php16
1 files changed, 3 insertions, 13 deletions
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<string,mixed>|array<string,mixed>|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<string,mixed>|array<string,mixed>|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<string,mixed>|array<string,mixed>|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;
}