From 928e806016d57eda59bbaa28a041166943574cb0 Mon Sep 17 00:00:00 2001 From: Julien Chaffraix Date: Wed, 9 Oct 2024 13:01:57 -0700 Subject: [PATCH] [Review] Switch to `array_keys` Co-authored-by: Casey Peel --- pinc/Activity.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pinc/Activity.inc b/pinc/Activity.inc index b209fa9c9..039af28ac 100644 --- a/pinc/Activity.inc +++ b/pinc/Activity.inc @@ -396,7 +396,7 @@ function get_user_scores(string $username, array $criteria): array $user_obj = $username == User::current_username() ? User::load_current() : new User($username); $user_scores = []; - foreach ($criteria as $criterion_code => $_) { + foreach (array_keys($criteria) as $criterion_code) { $user_scores[$criterion_code] = get_user_score($user_obj, $criterion_code); } return $user_scores;