Hard deprecate UtfNormalUtil
authorMax Semenik <maxsem.wiki@gmail.com>
Tue, 15 Aug 2017 01:44:40 +0000 (18:44 -0700)
committerMax Semenik <maxsem.wiki@gmail.com>
Tue, 6 Feb 2018 22:44:37 +0000 (14:44 -0800)
Deprecated in 1.25, last vestiges have been removed.

Inline one last function that's not supposed to be public anyway.

Change-Id: If44c6a9cce7d2d95dc63e6f135b73b8c969f1c07

includes/compat/normal/UtfNormalUtil.php
maintenance/language/digit2html.php
maintenance/language/generateCollationData.php

index d60c8e3..0e29dd0 100644 (file)
@@ -37,6 +37,7 @@ use UtfNormal\Utils;
  * @deprecated since 1.25, use UtfNormal\Utils directly
  */
 function codepointToUtf8( $codepoint ) {
+       wfDeprecated( __FUNCTION__, '1.25' );
        return Utils::codepointToUtf8( $codepoint );
 }
 
@@ -52,6 +53,7 @@ function codepointToUtf8( $codepoint ) {
  * @deprecated since 1.25, use UtfNormal\Utils directly
  */
 function hexSequenceToUtf8( $sequence ) {
+       wfDeprecated( __FUNCTION__, '1.25' );
        return Utils::hexSequenceToUtf8( $sequence );
 }
 
@@ -65,6 +67,7 @@ function hexSequenceToUtf8( $sequence ) {
  * @private
  */
 function utf8ToHexSequence( $str ) {
+       wfDeprecated( __FUNCTION__, '1.25' );
        $buf = '';
        foreach ( preg_split( '//u', $str, -1, PREG_SPLIT_NO_EMPTY ) as $cp ) {
                $buf .= sprintf( '%04x ', UtfNormal\Utils::utf8ToCodepoint( $cp ) );
@@ -83,6 +86,7 @@ function utf8ToHexSequence( $str ) {
  * @deprecated since 1.25, use UtfNormal\Utils directly
  */
 function utf8ToCodepoint( $char ) {
+       wfDeprecated( __FUNCTION__, '1.25' );
        return Utils::utf8ToCodepoint( $char );
 }
 
@@ -95,5 +99,6 @@ function utf8ToCodepoint( $char ) {
  * @deprecated since 1.25, use UtfNormal\Utils directly
  */
 function escapeSingleString( $string ) {
+       wfDeprecated( __FUNCTION__, '1.25' );
        return Utils::escapeSingleString( $string );
 }
index 9aacf51..f1e74ad 100644 (file)
@@ -57,7 +57,7 @@ class Digit2Html extends Maintenance {
 
                        $this->output( "OK\n\$digitTransformTable = [\n" );
                        foreach ( $digitTransformTable as $latin => $translation ) {
-                               $htmlent = utf8ToHexSequence( $translation );
+                               $htmlent = bin2hex( $translation );
                                $this->output( "'$latin' => '$translation', # &#x$htmlent;\n" );
                        }
                        $this->output( "];\n" );
index 85949d8..fafc1c6 100644 (file)
@@ -323,11 +323,6 @@ class GenerateCollationData extends Maintenance {
                        $headerChars[] = $char;
                        if ( $primaryCollator->compare( $char, $prevChar ) <= 0 ) {
                                $numOutOfOrder++;
-                               /*
-                               printf( "Out of order: U+%05X > U+%05X\n",
-                                       utf8ToCodepoint( $prevChar ),
-                                       utf8ToCodepoint( $char ) );
-                                */
                        }
                        $prevChar = $char;