From 9c49a2b86b84e3841070661655bfc0c4bce6d7c8 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 15 Jun 2025 19:59:13 +0200 Subject: [PATCH] [ticket/17399] Fix declaration to be in line with PHP documentation PHPBB-17399 --- phpBB/phpbb/language/language_file_helper.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/phpBB/phpbb/language/language_file_helper.php b/phpBB/phpbb/language/language_file_helper.php index 809df8728e..a6e8b507fc 100644 --- a/phpBB/phpbb/language/language_file_helper.php +++ b/phpBB/phpbb/language/language_file_helper.php @@ -129,10 +129,23 @@ class language_file_helper /** * Sorts the languages by their name instead of iso code * - * @return array + * @param mixed $a First language data + * @param mixed $b Second language data + * @return int */ - private static function sort_by_local_name($a, $b) + private static function sort_by_local_name(mixed $a, mixed $b): int { - return $a['local_name'] > $b['local_name']; + if ($a['local_name'] > $b['local_name']) + { + return 1; + } + else if ($a['local_name'] < $b['local_name']) + { + return -1; + } + else + { + return 0; + } } }