X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=languages%2FLanguage.php;h=50ed513734a5a3d94c5e6020d5b185cc0eb63673;hb=50f546aa3e891a5dae126aef4086d28ea7af8f30;hp=16135361298c13c6d9c3916f4f68ab72ab98c36a;hpb=69e3367224c003163fcc7cce0142b584f13a744e;p=lhc%2Fweb%2Fwiklou.git diff --git a/languages/Language.php b/languages/Language.php index 1613536129..50ed513734 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -34,6 +34,8 @@ if ( function_exists( 'mb_strtoupper' ) ) { mb_internal_encoding( 'UTF-8' ); } +use CLDRPluralRuleParser\Evaluator; + /** * Internationalisation code * @ingroup Language @@ -2549,10 +2551,13 @@ class Language { * * @param MWTimestamp $time * @param MWTimestamp|null $relativeTo The base timestamp to compare to (defaults to now) - * @param User|null $user User the timestamp is being generated for (or null to use main context's user) + * @param User|null $user User the timestamp is being generated for + * (or null to use main context's user) * @return string Formatted timestamp */ - public function getHumanTimestamp( MWTimestamp $time, MWTimestamp $relativeTo = null, User $user = null ) { + public function getHumanTimestamp( + MWTimestamp $time, MWTimestamp $relativeTo = null, User $user = null + ) { if ( $relativeTo === null ) { $relativeTo = new MWTimestamp(); } @@ -2587,7 +2592,9 @@ class Language { * @return string Human timestamp * @since 1.26 */ - private function getHumanTimestampInternal( MWTimestamp $ts, MWTimestamp $relativeTo, User $user ) { + private function getHumanTimestampInternal( + MWTimestamp $ts, MWTimestamp $relativeTo, User $user + ) { $diff = $ts->diff( $relativeTo ); $diffDay = (bool)( (int)$ts->timestamp->format( 'w' ) - (int)$relativeTo->timestamp->format( 'w' ) ); @@ -2678,7 +2685,7 @@ class Language { # Even with //IGNORE iconv can whine about illegal characters in # *input* string. We just ignore those too. # REF: http://bugs.php.net/bug.php?id=37166 - # REF: https://bugzilla.wikimedia.org/show_bug.cgi?id=16885 + # REF: https://phabricator.wikimedia.org/T18885 MediaWiki\suppressWarnings(); $text = iconv( $in, $out . '//IGNORE', $string ); MediaWiki\restoreWarnings(); @@ -4968,7 +4975,7 @@ class Language { */ public function getPluralRuleIndexNumber( $number ) { $pluralRules = $this->getCompiledPluralRules(); - $form = CLDRPluralRuleEvaluator::evaluateCompiled( $number, $pluralRules ); + $form = Evaluator::evaluateCompiled( $number, $pluralRules ); return $form; }