Fix and update Composer autoload

This commit is contained in:
Frédéric Guillot
2021-12-16 13:44:31 -08:00
committed by Frédéric Guillot
parent 3e139ab6f4
commit 4cfdb88813
78 changed files with 1854 additions and 1893 deletions

View File

@@ -43,9 +43,7 @@ trait TranslatorTrait
*/
public function trans($id, array $parameters = [], $domain = null, $locale = null)
{
if ('' === $id = (string) $id) {
return '';
}
$id = (string) $id;
if (!isset($parameters['%count%']) || !is_numeric($parameters['%count%'])) {
return strtr($id, $parameters);
@@ -92,8 +90,8 @@ EOF;
}
}
} else {
$leftNumber = '-Inf' === $matches['left'] ? -\INF : (float) $matches['left'];
$rightNumber = is_numeric($matches['right']) ? (float) $matches['right'] : \INF;
$leftNumber = '-Inf' === $matches['left'] ? -INF : (float) $matches['left'];
$rightNumber = \is_numeric($matches['right']) ? (float) $matches['right'] : INF;
if (('[' === $matches['left_delimiter'] ? $number >= $leftNumber : $number > $leftNumber)
&& (']' === $matches['right_delimiter'] ? $number <= $rightNumber : $number < $rightNumber)
@@ -119,7 +117,7 @@ EOF;
$message = sprintf('Unable to choose a translation for "%s" with locale "%s" for value "%d". Double check that this translation has the correct plural options (e.g. "There is one apple|There are %%count%% apples").', $id, $locale, $number);
if (class_exists(InvalidArgumentException::class)) {
if (\class_exists(InvalidArgumentException::class)) {
throw new InvalidArgumentException($message);
}