1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/16955] Fix another batch of docblocks

PHPBB3-16955
This commit is contained in:
Marc Alexander
2022-12-26 14:50:57 +01:00
parent 96911b7403
commit 5b23dcd606
25 changed files with 93 additions and 75 deletions

View File

@@ -298,7 +298,7 @@ class language
if ($lang === $key)
{
return $key;
return (string) $key;
}
// If the language entry is a string, we simply mimic sprintf() behaviour
@@ -315,7 +315,7 @@ class language
else if (count($lang) == 0)
{
// If the language entry is an empty array, we just return the language key
return $key;
return (string) $key;
}
// It is an array... now handle different nullar/singular/plural forms
@@ -406,13 +406,6 @@ class language
$number = (int) $number;
$plural_rule = ($force_rule !== false) ? $force_rule : ((isset($this->lang['PLURAL_RULE'])) ? $this->lang['PLURAL_RULE'] : 1);
if ($plural_rule > 15 || $plural_rule < 0)
{
throw new invalid_plural_rule_exception('INVALID_PLURAL_RULE', array(
'plural_rule' => $plural_rule,
));
}
/**
* The following plural rules are based on a list published by the Mozilla Developer Network
* https://developer.mozilla.org/en/Localization_and_Plurals
@@ -565,6 +558,9 @@ class language
* 2 - everything else: 0, 2, 3, ... 10, 11, 12, ... 20, 22, ...
*/
return (($number % 10 === 1) && ($number % 100 != 11)) ? 1 : 2;
default:
throw new invalid_plural_rule_exception('INVALID_PLURAL_RULE', ['plural_rule' => $plural_rule]);
}
}