Skip to content

Commit

Permalink
Merge pull request opencaching#618 from opencaching/php7.4-compat
Browse files Browse the repository at this point in the history
PHP7.4 compat - replace create_function by anonymous function
  • Loading branch information
deg-pl authored Mar 30, 2022
2 parents d4b4826 + 7c3460e commit 34975e3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions okapi/services/caches/search/SearchAssistant.php
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ public function prepare_common_search_params()
throw new InvalidParam('found_by', $e->whats_wrong_about_it);
}

$internal_user_ids = array_map(create_function('$user', 'return $user["internal_id"];'), $users);
$internal_user_ids = array_map(function ($user) { return $user["internal_id"]; }, $users);
if (Settings::get('USE_SQL_SUBQUERIES')) {
$found_cache_subquery = self::get_found_cache_ids_subquery($internal_user_ids);
$where_conds[] = "caches.cache_id in (".$found_cache_subquery.")";
Expand All @@ -450,7 +450,7 @@ public function prepare_common_search_params()
throw new InvalidParam('not_found_by', $e->whats_wrong_about_it);
}

$internal_user_ids = array_map(create_function('$user', 'return $user["internal_id"];'), $users);
$internal_user_ids = array_map(function ($user) { return $user["internal_id"]; }, $users);
if (Settings::get('USE_SQL_SUBQUERIES')) {
$found_cache_subquery = self::get_found_cache_ids_subquery($internal_user_ids);
$where_conds[] = "caches.cache_id not in (".$found_cache_subquery.")";
Expand Down Expand Up @@ -485,7 +485,7 @@ public function prepare_common_search_params()
} catch (InvalidParam $e) { # too many uuids
throw new InvalidParam('not_found_by', $e->whats_wrong_about_it);
}
$internal_user_ids = array_map(create_function('$user', 'return $user["internal_id"];'), $users);
$internal_user_ids = array_map(function ($user) { return $user["internal_id"]; }, $users);
$where_conds[] = self::get_recommended_by_sql($internal_user_ids);
}

Expand Down

0 comments on commit 34975e3

Please sign in to comment.