Skip to content

Commit 7c3460e

Browse files
committed
PHP7.4 compat - related with #602
Replace create_function by anonymous function
1 parent 11df72b commit 7c3460e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

okapi/services/caches/search/SearchAssistant.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ public function prepare_common_search_params()
427427
throw new InvalidParam('found_by', $e->whats_wrong_about_it);
428428
}
429429

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

453-
$internal_user_ids = array_map(create_function('$user', 'return $user["internal_id"];'), $users);
453+
$internal_user_ids = array_map(function ($user) { return $user["internal_id"]; }, $users);
454454
if (Settings::get('USE_SQL_SUBQUERIES')) {
455455
$found_cache_subquery = self::get_found_cache_ids_subquery($internal_user_ids);
456456
$where_conds[] = "caches.cache_id not in (".$found_cache_subquery.")";
@@ -485,7 +485,7 @@ public function prepare_common_search_params()
485485
} catch (InvalidParam $e) { # too many uuids
486486
throw new InvalidParam('not_found_by', $e->whats_wrong_about_it);
487487
}
488-
$internal_user_ids = array_map(create_function('$user', 'return $user["internal_id"];'), $users);
488+
$internal_user_ids = array_map(function ($user) { return $user["internal_id"]; }, $users);
489489
$where_conds[] = self::get_recommended_by_sql($internal_user_ids);
490490
}
491491

0 commit comments

Comments
 (0)