From a63c949a5522a8fdeae2dfa77bb39565727f7a0a Mon Sep 17 00:00:00 2001 From: wn_ Date: Fri, 12 Aug 2022 14:41:21 +0000 Subject: Use arrow functions in some places. --- classes/pref/prefs.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'classes/pref') diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php index 3e651297e..01b58005b 100644 --- a/classes/pref/prefs.php +++ b/classes/pref/prefs.php @@ -872,13 +872,13 @@ class Pref_Prefs extends Handler_Protected { PluginHost::getInstance()->get_hooks(PluginHost::HOOK_FEED_PARSED), PluginHost::getInstance()->get_hooks(PluginHost::HOOK_FETCH_FEED)); - $feed_handlers = array_filter($feed_handlers, function($plugin) use ($feed_handler_whitelist) { - return in_array(get_class($plugin), $feed_handler_whitelist) === false; }); + $feed_handlers = array_filter($feed_handlers, + fn($plugin) => in_array(get_class($plugin), $feed_handler_whitelist) === false); if (count($feed_handlers) > 0) { print_error( T_sprintf("The following plugins use per-feed content hooks. This may cause excessive data usage and origin server load resulting in a ban of your instance: %s" , - implode(", ", array_map(function($plugin) { return get_class($plugin); }, $feed_handlers)) + implode(", ", array_map(fn($plugin) => get_class($plugin), $feed_handlers)) ) . " (".__("More info...").")" ); } @@ -1067,9 +1067,7 @@ class Pref_Prefs extends Handler_Protected { } } - $rv = array_values(array_filter($rv, function ($item) { - return $item["rv"]["need_update"]; - })); + $rv = array_values(array_filter($rv, fn($item) => $item["rv"]["need_update"])); return $rv; } -- cgit v1.2.3