aboutsummaryrefslogtreecommitdiff
path: root/app/Models/Context.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-05-11 13:02:04 +0200
committerGravatar GitHub <noreply@github.com> 2023-05-11 13:02:04 +0200
commit6e2f2f1c1e98ecd86aa89c6547beb742d7385d18 (patch)
tree7ba9f5aebb01d12045b9067a86b5060ba13dca18 /app/Models/Context.php
parentfe7d9bbcd68660a59b813346c236b61b25a51c80 (diff)
A few additional PHPStan rules (#5388)
A subset of https://github.com/phpstan/phpstan-strict-rules
Diffstat (limited to 'app/Models/Context.php')
-rw-r--r--app/Models/Context.php8
1 files changed, 4 insertions, 4 deletions
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 '';
}