Add @since tags to Collation stuff
authoraddshore <addshorewiki@gmail.com>
Sun, 3 Apr 2016 08:36:49 +0000 (11:36 +0300)
committeraddshore <addshorewiki@gmail.com>
Sun, 3 Apr 2016 08:37:40 +0000 (11:37 +0300)
Change-Id: Iec56ac4d1418737d171f8faa9c8f498fba5383ee

includes/collation/Collation.php
includes/collation/CollationCkb.php
includes/collation/CollationEt.php
includes/collation/IcuCollation.php
includes/collation/IdentityCollation.php
includes/collation/UppercaseCollation.php

index 84d1f24..9fb0660 100644 (file)
  * @file
  */
 
+/**
+ * @since 1.16.3
+ * @author Tim Starling
+ */
 abstract class Collation {
        private static $instance;
 
        /**
+        * @since 1.16.3
         * @return Collation
         */
-       static function singleton() {
+       public static function singleton() {
                if ( !self::$instance ) {
                        global $wgCategoryCollation;
                        self::$instance = self::factory( $wgCategoryCollation );
@@ -35,11 +40,12 @@ abstract class Collation {
        }
 
        /**
+        * @since 1.16.3
         * @throws MWException
         * @param string $collationName
         * @return Collation
         */
-       static function factory( $collationName ) {
+       public static function factory( $collationName ) {
                switch ( $collationName ) {
                        case 'uppercase':
                                return new UppercaseCollation;
@@ -78,6 +84,8 @@ abstract class Collation {
         * has no other particular expectations (and that one can be changed if
         * necessary).
         *
+        * @since 1.16.3
+        *
         * @param string $string UTF-8 string
         * @return string Binary sortkey
         */
@@ -103,6 +111,8 @@ abstract class Collation {
         *
         * etc., assuming for the sake of argument that $wgCapitalLinks is false.
         *
+        * @since 1.16.3
+        *
         * @param string $string UTF-8 string
         * @return string UTF-8 string corresponding to the first letter of input
         */
index da1a562..01a4f7f 100644 (file)
  * Workaround for the lack of support of Sorani Kurdish / Central Kurdish language ('ckb') in ICU.
  *
  * Uses the same collation rules as Persian / Farsi ('fa'), but different characters for digits.
+ *
+ * @since 1.23
  */
 class CollationCkb extends IcuCollation {
-       function __construct() {
+       public function __construct() {
                // This will set $locale and collators, which affect the actual sorting order
                parent::__construct( 'fa' );
                // Override the 'fa' language set by parent constructor, which affects #getFirstLetterData()
index d80bce3..5dc9fa2 100644 (file)
  * Estonian. We work around this by replacing 'W' and 'w' with 'ᴡ' U+1D21 'LATIN LETTER SMALL
  * CAPITAL W' for sortkey generation, which is collated like 'W' and is not tailored to have the
  * same primary weight as 'V' in Estonian.
+ *
+ * @since 1.24
  */
 class CollationEt extends IcuCollation {
-       function __construct() {
+       public function __construct() {
                parent::__construct( 'et' );
        }
 
@@ -48,11 +50,11 @@ class CollationEt extends IcuCollation {
                );
        }
 
-       function getSortKey( $string ) {
+       public function getSortKey( $string ) {
                return parent::getSortKey( self::mangle( $string ) );
        }
 
-       function getFirstLetter( $string ) {
+       public function getFirstLetter( $string ) {
                return self::unmangle( parent::getFirstLetter( self::mangle( $string ) ) );
        }
 }
index fee4cd0..0aa1406 100644 (file)
@@ -18,6 +18,9 @@
  * @file
  */
 
+/**
+ * @since 1.16.3
+ */
 class IcuCollation extends Collation {
        const FIRST_LETTER_VERSION = 2;
 
@@ -159,6 +162,9 @@ class IcuCollation extends Collation {
                'uz' => [ "Ch", "G'", "Ng", "O'", "Sh" ],
        ];
 
+       /**
+        * @since 1.16.3
+        */
        const RECORD_LENGTH = 14;
 
        public function __construct( $locale ) {
@@ -226,6 +232,9 @@ class IcuCollation extends Collation {
                return $this->getLetterByIndex( $min );
        }
 
+       /**
+        * @since 1.16.3
+        */
        public function getFirstLetterData() {
                if ( $this->firstLetterData !== null ) {
                        return $this->firstLetterData;
@@ -377,6 +386,9 @@ class IcuCollation extends Collation {
                return $data;
        }
 
+       /**
+        * @since 1.16.3
+        */
        public function getLetterByIndex( $index ) {
                if ( $this->firstLetterData === null ) {
                        $this->getFirstLetterData();
@@ -384,6 +396,9 @@ class IcuCollation extends Collation {
                return $this->firstLetterData['chars'][$index];
        }
 
+       /**
+        * @since 1.16.3
+        */
        public function getSortKeyByLetterIndex( $index ) {
                if ( $this->firstLetterData === null ) {
                        $this->getFirstLetterData();
@@ -391,6 +406,9 @@ class IcuCollation extends Collation {
                return $this->firstLetterData['keys'][$index];
        }
 
+       /**
+        * @since 1.16.3
+        */
        public function getFirstLetterCount() {
                if ( $this->firstLetterData === null ) {
                        $this->getFirstLetterData();
@@ -398,7 +416,10 @@ class IcuCollation extends Collation {
                return count( $this->firstLetterData['chars'] );
        }
 
-       static function isCjk( $codepoint ) {
+       /**
+        * @since 1.16.3
+        */
+       public static function isCjk( $codepoint ) {
                foreach ( self::$cjkBlocks as $block ) {
                        if ( $codepoint >= $block[0] && $codepoint <= $block[1] ) {
                                return true;
index 9a99f1a..46e7f38 100644 (file)
@@ -23,6 +23,8 @@
  *
  * Does sorting based on binary value of the string.
  * Like how things were pre 1.17.
+ *
+ * @since 1.18
  */
 class IdentityCollation extends Collation {
 
index c589a76..92a4c3b 100644 (file)
@@ -15,6 +15,8 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  * http://www.gnu.org/copyleft/gpl.html
  *
+ * @since 1.16.3
+ *
  * @file
  */