*/
abstract class Collation {
- static $instance;
+ private static $instance;
/**
* @return Collation
}
class UppercaseCollation extends Collation {
- var $lang;
+ private $lang;
+
function __construct() {
// Get a language object so that we can use the generic UTF-8 uppercase
// function there
class IcuCollation extends Collation {
const FIRST_LETTER_VERSION = 2;
- var $primaryCollator, $mainCollator, $locale, $digitTransformLanguage;
- var $firstLetterData;
+ /** @var Collator */
+ private $primaryCollator;
+
+ /** @var Collator */
+ private $mainCollator;
+
+ /** @var */
+ private $locale;
+
+ /** @var Language */
+ protected $digitTransformLanguage;
+
+ /** @var array */
+ private $firstLetterData;
/**
* Unified CJK blocks.
* is pretty useless for sorting Chinese text anyway. Japanese and Korean
* blocks are not included here, because they are smaller and more useful.
*/
- static $cjkBlocks = array(
+ private static $cjkBlocks = array(
array( 0x2E80, 0x2EFF ), // CJK Radicals Supplement
array( 0x2F00, 0x2FDF ), // Kangxi Radicals
array( 0x2FF0, 0x2FFF ), // Ideographic Description Characters
* Empty arrays are intended; this signifies that the data for the language is
* available and that there are, in fact, no additional letters to consider.
*/
- static $tailoringFirstLetters = array(
+ private static $tailoringFirstLetters = array(
// Verified by native speakers
'be' => array( "Ё" ),
'be-tarask' => array( "Ё" ),
+ 'cy' => array( "Ch", "Dd", "Ff", "Ng", "Ll", "Ph", "Rh", "Th" ),
'en' => array(),
+ 'fa' => array( "آ", "ء", "ه" ),
'fi' => array( "Å", "Ä", "Ö" ),
+ 'fr' => array(),
'hu' => array( "Cs", "Dz", "Dzs", "Gy", "Ly", "Ny", "Ö", "Sz", "Ty", "Ü", "Zs" ),
+ 'is' => array( "Á", "Ð", "É", "Í", "Ó", "Ú", "Ý", "Þ", "Æ", "Ö", "Å" ),
'it' => array(),
+ 'lv' => array( "Č", "Ģ", "Ķ", "Ļ", "Ņ", "Š", "Ž" ),
'pl' => array( "Ą", "Ć", "Ę", "Ł", "Ń", "Ó", "Ś", "Ź", "Ż" ),
'pt' => array(),
'ru' => array(),
'ca' => array(),
'co' => array(),
'cs' => array( "Č", "Ch", "Ř", "Š", "Ž" ),
- 'cy' => array( "Ch", "Dd", "Ff", "Ng", "Ll", "Ph", "Rh", "Th" ),
'da' => array( "Æ", "Ø", "Å" ),
'de' => array(),
'dsb' => array( "Č", "Ć", "Dź", "Ě", "Ch", "Ł", "Ń", "Ŕ", "Š", "Ś", "Ž", "Ź" ),
'es' => array( "Ñ" ),
'et' => array( "Š", "Ž", "Õ", "Ä", "Ö", "Ü" ),
'eu' => array( "Ñ" ),
- 'fa' => array( "آ", "ء", "ه" ),
'fo' => array( "Á", "Ð", "Í", "Ó", "Ú", "Ý", "Æ", "Ø", "Å" ),
- 'fr' => array(),
'fur' => array( "À", "Á", "Â", "È", "Ì", "Ò", "Ù" ),
'fy' => array(),
'ga' => array(),
'gl' => array( "Ch", "Ll", "Ñ" ),
'hr' => array( "Č", "Ć", "Dž", "Đ", "Lj", "Nj", "Š", "Ž" ),
'hsb' => array( "Č", "Dź", "Ě", "Ch", "Ł", "Ń", "Ř", "Š", "Ć", "Ž" ),
- 'is' => array( "Á", "Ð", "É", "Í", "Ó", "Ú", "Ý", "Þ", "Æ", "Ö", "Å" ),
'kk' => array( "Ү", "І" ),
'kl' => array( "Æ", "Ø", "Å" ),
'ku' => array( "Ç", "Ê", "Î", "Ş", "Û" ),
'la' => array(),
'lb' => array(),
'lt' => array( "Č", "Š", "Ž" ),
- 'lv' => array( "Č", "Ģ", "Ķ", "Ļ", "Ņ", "Š", "Ž" ),
'mk' => array(),
'mo' => array( "Ă", "Â", "Î", "Ş", "Ţ" ),
'mt' => array( "Ċ", "Ġ", "Għ", "Ħ", "Ż" ),
return count( $this->firstLetterData['chars'] );
}
- /**
- * Do a binary search, and return the index of the largest item that sorts
- * less than or equal to the target value.
- *
- * @deprecated since 1.23; use ArrayUtils::findLowerBound() instead
- *
- * @param array $valueCallback A function to call to get the value with
- * a given array index.
- * @param int $valueCount The number of items accessible via $valueCallback,
- * indexed from 0 to $valueCount - 1
- * @param array $comparisonCallback A callback to compare two values, returning
- * -1, 0 or 1 in the style of strcmp().
- * @param string $target The target value to find.
- *
- * @return int|bool The item index of the lower bound, or false if the target value
- * sorts before all items.
- */
- function findLowerBound( $valueCallback, $valueCount, $comparisonCallback, $target ) {
- wfDeprecated( __METHOD__, '1.23' );
- return ArrayUtils::findLowerBound( $valueCallback, $valueCount, $comparisonCallback, $target );
- }
-
static function isCjk( $codepoint ) {
foreach ( self::$cjkBlocks as $block ) {
if ( $codepoint >= $block[0] && $codepoint <= $block[1] ) {