mb_internal_encoding( 'UTF-8' );
}
+use CLDRPluralRuleParser\Evaluator;
+
/**
* Internationalisation code
* @ingroup 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();
}
* @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' ) );
# 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();
*/
public function getPluralRuleIndexNumber( $number ) {
$pluralRules = $this->getCompiledPluralRules();
- $form = CLDRPluralRuleEvaluator::evaluateCompiled( $number, $pluralRules );
+ $form = Evaluator::evaluateCompiled( $number, $pluralRules );
return $form;
}