aboutsummaryrefslogtreecommitdiff
path: root/app/Models/Context.php
diff options
context:
space:
mode:
authorGravatar Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com> 2024-11-28 17:11:04 +0100
committerGravatar GitHub <noreply@github.com> 2024-11-28 17:11:04 +0100
commit15745d42b779ad14efde2932ab116f45eee39246 (patch)
tree2528a36184d8152d4f2d90dc73df680f84bbe1d1 /app/Models/Context.php
parent604b186638276203c8495a3ee86da0cc240ab4d0 (diff)
Upgrade code to php 8.1 (#6748)
* revert Fix code indentation Fix code Upgrade code to php 8.1 * fix remarques * code review * code review * code review * Apply suggestions from code review * code review * Fixes * Many remainging updates of array syntax * Lost case 'reading-list' * Uneeded PHPDoc --------- Co-authored-by: Luc Sanchez <l.sanchez-prestataire@alptis.fr> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'app/Models/Context.php')
-rw-r--r--app/Models/Context.php28
1 files changed, 10 insertions, 18 deletions
diff --git a/app/Models/Context.php b/app/Models/Context.php
index 26212a0ef..f39fd0eca 100644
--- a/app/Models/Context.php
+++ b/app/Models/Context.php
@@ -347,24 +347,16 @@ final class FreshRSS_Context {
$type = substr($get, 0, 1);
$id = substr($get, 2);
- switch ($type) {
- case 'a':
- return self::$current_get['all'];
- case 'i':
- return self::$current_get['important'];
- case 's':
- return self::$current_get['starred'];
- case 'f':
- return self::$current_get['feed'] == $id;
- case 'c':
- return self::$current_get['category'] == $id;
- case 't':
- return self::$current_get['tag'] == $id;
- case 'T':
- return self::$current_get['tags'] || self::$current_get['tag'];
- default:
- return false;
- }
+ return match ($type) {
+ 'a' => self::$current_get['all'],
+ 'i' => self::$current_get['important'],
+ 's' => self::$current_get['starred'],
+ 'f' => self::$current_get['feed'] == $id,
+ 'c' => self::$current_get['category'] == $id,
+ 't' => self::$current_get['tag'] == $id,
+ 'T' => self::$current_get['tags'] || self::$current_get['tag'],
+ default => false,
+ };
}
/**