From 6e2f2f1c1e98ecd86aa89c6547beb742d7385d18 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 11 May 2023 13:02:04 +0200 Subject: A few additional PHPStan rules (#5388) A subset of https://github.com/phpstan/phpstan-strict-rules --- app/Models/Context.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app/Models/Context.php') diff --git a/app/Models/Context.php b/app/Models/Context.php index ce29ebd5c..c10119d7d 100644 --- a/app/Models/Context.php +++ b/app/Models/Context.php @@ -251,14 +251,14 @@ final class FreshRSS_Context { * Return the current get as a string or an array. * * If $array is true, the first item of the returned value is 'f' or 'c' or 't' and the second is the id. - * @phpstan-return ($asArray is true ? array{'c'|'f'|'t',bool|int} : string) + * @phpstan-return ($asArray is true ? array{'a'|'c'|'f'|'s'|'t'|'T',bool|int} : string) * @return string|array{string,bool|int} */ public static function currentGet(bool $asArray = false) { if (self::$current_get['all']) { - return 'a'; + return $asArray ? ['a', true] : 'a'; } elseif (self::$current_get['starred']) { - return 's'; + return $asArray ? ['s', true] : 's'; } elseif (self::$current_get['feed']) { if ($asArray) { return array('f', self::$current_get['feed']); @@ -278,7 +278,7 @@ final class FreshRSS_Context { return 't_' . self::$current_get['tag']; } } elseif (self::$current_get['tags']) { - return 'T'; + return $asArray ? ['T', true] : 'T'; } return ''; } -- cgit v1.2.3