(bug 28868) Include the number of pages in the default getLongDesc for multipaged...
[lhc/web/wiklou.git] / includes / Collation.php
index d579d58..4cd921d 100644 (file)
@@ -3,6 +3,9 @@
 abstract class Collation {
        static $instance;
 
+       /**
+        * @return Collation
+        */
        static function singleton() {
                if ( !self::$instance ) {
                        global $wgCategoryCollation;
@@ -11,6 +14,11 @@ abstract class Collation {
                return self::$instance;
        }
 
+       /**
+        * @throws MWException
+        * @param $collationName string
+        * @return Collation
+        */
        static function factory( $collationName ) {
                switch( $collationName ) {
                        case 'uppercase':
@@ -26,7 +34,7 @@ abstract class Collation {
         * Given a string, convert it to a (hopefully short) key that can be used
         * for efficient sorting.  A binary sort according to the sortkeys
         * corresponds to a logical sort of the corresponding strings.  Current
-        * code expects that a null character should sort before all others, but
+        * code expects that a line feed character should sort before all others, but
         * has no other particular expectations (and that one can be changed if
         * necessary).
         *
@@ -130,6 +138,9 @@ class IcuCollation extends Collation {
        }
 
        function getSortKey( $string ) {
+               // intl extension produces non null-terminated
+               // strings. Appending '' fixes it so that it doesn't generate
+               // a warning on each access in debug php.
                wfSuppressWarnings();
                $key = $this->mainCollator->getSortKey( $string ) . '';
                wfRestoreWarnings();
@@ -256,13 +267,13 @@ class IcuCollation extends Collation {
         * Do a binary search, and return the index of the largest item that sorts 
         * less than or equal to the target value.
         *
-        * @param $valueCallback A function to call to get the value with 
+        * @param $valueCallback array A function to call to get the value with
         *     a given array index.
-        * @param $valueCount The number of items accessible via $valueCallback, 
+        * @param $valueCount int The number of items accessible via $valueCallback,
         *     indexed from 0 to $valueCount - 1
-        * @param $comparisonCallback A callback to compare two values, returning 
+        * @param $comparisonCallback array A callback to compare two values, returning
         *     -1, 0 or 1 in the style of strcmp().
-        * @param $target The target value to find.
+        * @param $target string The target value to find.
         *
         * @return The item index of the lower bound, or false if the target value
         *     sorts before all items.