X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fnormal%2FUtfNormal.php;h=5a091afc96e162dbcb65d0af936cb6289392051b;hb=525f157e17c0bfaf65ea90e47a88b873bd17c576;hp=64d96187d5f76920614777bdf53823c8fec73d90;hpb=8f5ce91a043f74ea174c1f5feeb299f4cd5823eb;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/normal/UtfNormal.php b/includes/normal/UtfNormal.php index 64d96187d5..5a091afc96 100644 --- a/includes/normal/UtfNormal.php +++ b/includes/normal/UtfNormal.php @@ -37,7 +37,7 @@ define( 'NORMALIZE_INTL', function_exists( 'normalizer_normalize' ) ); * * Not as fast as I'd like, but should be usable for most purposes. * UtfNormal::toNFC() will bail early if given ASCII text or text - * it can quickly deterimine is already normalized. + * it can quickly determine is already normalized. * * All functions can be called static. * @@ -73,7 +73,7 @@ class UtfNormal { * Fast return for pure ASCII strings; some lesser optimizations for * strings containing only known-good characters. Not as fast as toNFC(). * - * @param $string String: a UTF-8 string + * @param string $string a UTF-8 string * @return string a clean, shiny, normalized UTF-8 string */ static function cleanUp( $string ) { @@ -114,7 +114,7 @@ class UtfNormal { * Fast return for pure ASCII strings; some lesser optimizations for * strings containing only known-good characters. * - * @param $string String: a valid UTF-8 string. Input is not validated. + * @param string $string a valid UTF-8 string. Input is not validated. * @return string a UTF-8 string in normal form C */ static function toNFC( $string ) { @@ -132,7 +132,7 @@ class UtfNormal { * Convert a UTF-8 string to normal form D, canonical decomposition. * Fast return for pure ASCII strings. * - * @param $string String: a valid UTF-8 string. Input is not validated. + * @param string $string a valid UTF-8 string. Input is not validated. * @return string a UTF-8 string in normal form D */ static function toNFD( $string ) { @@ -151,7 +151,7 @@ class UtfNormal { * This may cause irreversible information loss, use judiciously. * Fast return for pure ASCII strings. * - * @param $string String: a valid UTF-8 string. Input is not validated. + * @param string $string a valid UTF-8 string. Input is not validated. * @return string a UTF-8 string in normal form KC */ static function toNFKC( $string ) { @@ -170,7 +170,7 @@ class UtfNormal { * This may cause irreversible information loss, use judiciously. * Fast return for pure ASCII strings. * - * @param $string String: a valid UTF-8 string. Input is not validated. + * @param string $string a valid UTF-8 string. Input is not validated. * @return string a UTF-8 string in normal form KD */ static function toNFKD( $string ) { @@ -190,14 +190,14 @@ class UtfNormal { */ static function loadData() { if( !isset( self::$utfCombiningClass ) ) { - require_once( __DIR__ . '/UtfNormalData.inc' ); + require_once __DIR__ . '/UtfNormalData.inc'; } } /** * Returns true if the string is _definitely_ in NFC. * Returns false if not or uncertain. - * @param $string String: a valid UTF-8 string. Input is not validated. + * @param string $string a valid UTF-8 string. Input is not validated. * @return bool */ static function quickIsNFC( $string ) { @@ -237,7 +237,7 @@ class UtfNormal { /** * Returns true if the string is _definitely_ in NFC. * Returns false if not or uncertain. - * @param $string String: a UTF-8 string, altered on output to be valid UTF-8 safe for XML. + * @param string $string a UTF-8 string, altered on output to be valid UTF-8 safe for XML. * @return bool */ static function quickIsNFCVerify( &$string ) { @@ -491,7 +491,7 @@ class UtfNormal { */ static function NFKD( $string ) { if( !isset( self::$utfCompatibilityDecomp ) ) { - require_once( 'UtfNormalDataK.inc' ); + require_once 'UtfNormalDataK.inc'; } return self::fastCombiningSort( self::fastDecompose( $string, self::$utfCompatibilityDecomp ) ); @@ -503,8 +503,8 @@ class UtfNormal { * (depending on which decomposition map is passed to us). * Input is assumed to be *valid* UTF-8. Invalid code will break. * @private - * @param $string String: valid UTF-8 string - * @param $map Array: hash of expanded decomposition map + * @param string $string valid UTF-8 string + * @param array $map hash of expanded decomposition map * @return string a UTF-8 string decomposed, not yet normalized (needs sorting) */ static function fastDecompose( $string, $map ) { @@ -564,7 +564,7 @@ class UtfNormal { * Sorts combining characters into canonical order. This is the * final step in creating decomposed normal forms D and KD. * @private - * @param $string String: a valid, decomposed UTF-8 string. Input is not validated. + * @param string $string a valid, decomposed UTF-8 string. Input is not validated. * @return string a UTF-8 string with combining characters sorted in canonical order */ static function fastCombiningSort( $string ) { @@ -616,7 +616,7 @@ class UtfNormal { * Produces canonically composed sequences, i.e. normal form C or KC. * * @private - * @param $string String: a valid UTF-8 string in sorted normal form D or KD. Input is not validated. + * @param string $string a valid UTF-8 string in sorted normal form D or KD. Input is not validated. * @return string a UTF-8 string with canonical precomposed characters used where possible */ static function fastCompose( $string ) { @@ -627,8 +627,8 @@ class UtfNormal { $lastHangul = 0; $startChar = ''; $combining = ''; - $x1 = ord(substr(UTF8_HANGUL_VBASE,0,1)); - $x2 = ord(substr(UTF8_HANGUL_TEND,0,1)); + $x1 = ord(substr(UTF8_HANGUL_VBASE, 0, 1)); + $x2 = ord(substr(UTF8_HANGUL_TEND, 0, 1)); for( $i = 0; $i < $len; $i++ ) { $c = $string[$i]; $n = ord( $c ); @@ -762,7 +762,7 @@ class UtfNormal { * Function to replace some characters that we don't want * but most of the native normalize functions keep. * - * @param $string String The string + * @param string $string The string * @return String String with the character codes replaced. */ private static function replaceForNativeNormalize( $string ) {