diff options
author | fox <[email protected]> | 2022-08-17 19:38:15 +0300 |
---|---|---|
committer | fox <[email protected]> | 2022-08-17 19:38:15 +0300 |
commit | 60658be5bc35192f9b2d9aaf413454f29fe51316 (patch) | |
tree | d7f6aa1b6bf3eaa4d7a9601e46e15441bc737d9e /classes/counters.php | |
parent | ec764f97e7e3e0fac20f93364c84dfa01651bf95 (diff) | |
parent | 0dbed700efa77355839a4d2cddf02f93203dc96f (diff) |
Merge pull request 'Use PHP 7.4 features' (#77) from wn/tt-rss:feature/php-7.4-stuff into master
Reviewed-on: https://dev.tt-rss.org/fox/tt-rss/pulls/77
Diffstat (limited to 'classes/counters.php')
-rw-r--r-- | classes/counters.php | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/classes/counters.php b/classes/counters.php index 8756b5acf..bc4d2d4a3 100644 --- a/classes/counters.php +++ b/classes/counters.php @@ -5,13 +5,13 @@ class Counters { * @return array<int, array<string, int|string>> */ static function get_all(): array { - return array_merge( - self::get_global(), - self::get_virt(), - self::get_labels(), - self::get_feeds(), - self::get_cats() - ); + return [ + ...self::get_global(), + ...self::get_virt(), + ...self::get_labels(), + ...self::get_feeds(), + ...self::get_cats(), + ]; } /** @@ -20,13 +20,13 @@ class Counters { * @return array<int, array<string, int|string>> */ static function get_conditional(array $feed_ids = null, array $label_ids = null): array { - return array_merge( - self::get_global(), - self::get_virt(), - self::get_labels($label_ids), - self::get_feeds($feed_ids), - self::get_cats(is_array($feed_ids) ? Feeds::_cats_of($feed_ids, $_SESSION["uid"], true) : null) - ); + return [ + ...self::get_global(), + ...self::get_virt(), + ...self::get_labels($label_ids), + ...self::get_feeds($feed_ids), + ...self::get_cats(is_array($feed_ids) ? Feeds::_cats_of($feed_ids, $_SESSION["uid"], true) : null) + ]; } /** @@ -93,11 +93,7 @@ class Counters { ue.feed_id = f.id AND ue.owner_uid = ?"); - $sth->execute(array_merge( - [$_SESSION['uid']], - $cat_ids, - [$_SESSION['uid']] - )); + $sth->execute([$_SESSION['uid'], ...$cat_ids, $_SESSION['uid']]); } else { $sth = $pdo->prepare("SELECT fc.id, @@ -170,7 +166,7 @@ class Counters { WHERE f.id = ue.feed_id AND ue.owner_uid = ? AND f.id IN ($feed_ids_qmarks) GROUP BY f.id"); - $sth->execute(array_merge([$_SESSION['uid']], $feed_ids)); + $sth->execute([$_SESSION['uid'], ...$feed_ids]); } else { $sth = $pdo->prepare("SELECT f.id, f.title, @@ -319,7 +315,7 @@ class Counters { LEFT JOIN ttrss_user_entries AS u1 ON u1.ref_id = article_id AND u1.owner_uid = ? WHERE ttrss_labels2.owner_uid = ? AND ttrss_labels2.id IN ($label_ids_qmarks) GROUP BY ttrss_labels2.id, ttrss_labels2.caption"); - $sth->execute(array_merge([$_SESSION["uid"], $_SESSION["uid"]], $label_ids)); + $sth->execute([$_SESSION["uid"], $_SESSION["uid"], ...$label_ids]); } else { $sth = $pdo->prepare("SELECT id, caption, |