Merge "Remove use of strencode() in buildLike()"
[lhc/web/wiklou.git] / maintenance / language / generateCollationData.php
index fcf2c96..2bb5e6b 100644 (file)
@@ -158,7 +158,8 @@ class GenerateCollationData extends Maintenance {
                // people like to use that as a fake no header symbol.
                $category = substr( $data['gc'], 0, 1 );
                if ( strpos( 'LNPS', $category ) === false
-                       && $data['cp'] !== '0020' ) {
+                       && $data['cp'] !== '0020'
+               ) {
                        return;
                }
                $cp = hexdec( $data['cp'] );
@@ -178,8 +179,8 @@ class GenerateCollationData extends Maintenance {
                // Calculate implicit weight per UTS #10 v6.0.0, sec 7.1.3
                if ( $data['UIdeo'] === 'Y' ) {
                        if ( $data['block'] == 'CJK Unified Ideographs'
-                               || $data['block'] == 'CJK Compatibility Ideographs' )
-                       {
+                               || $data['block'] == 'CJK Compatibility Ideographs'
+                       {
                                $base = 0xFB40;
                        } else {
                                $base = 0xFB80;
@@ -248,8 +249,8 @@ class GenerateCollationData extends Maintenance {
                        }
                        $this->weights[$cp] = $primary;
                        if ( $tertiary === '.0008'
-                               || $tertiary === '.000E' )
-                       {
+                               || $tertiary === '.000E'
+                       {
                                $goodTertiaryChars[$cp] = true;
                        }
                }
@@ -325,7 +326,7 @@ class GenerateCollationData extends Maintenance {
                        $char = codepointToUtf8( $cp );
                        $headerChars[] = $char;
                        if ( $primaryCollator->compare( $char, $prevChar ) <= 0 ) {
-                               $numOutOfOrder ++;
+                               $numOutOfOrder++;
                                /*
                                printf( "Out of order: U+%05X > U+%05X\n",
                                        utf8ToCodepoint( $prevChar ),
@@ -364,7 +365,7 @@ class UcdXmlReader {
                $xml = $this->open();
                $this->callback = $callback;
 
-               while ( $xml->name !== 'repertoire' && $xml->next() );
+               while ( $xml->name !== 'repertoire' && $xml->next() ) ;
 
                while ( $xml->read() ) {
                        if ( $xml->nodeType == XMLReader::ELEMENT ) {
@@ -388,8 +389,9 @@ class UcdXmlReader {
                if ( !$this->xml ) {
                        throw new MWException( __METHOD__ . ": unable to open {$this->fileName}" );
                }
-               while ( $this->xml->name !== 'ucd' && $this->xml->read() );
+               while ( $this->xml->name !== 'ucd' && $this->xml->read() ) ;
                $this->xml->read();
+
                return $this->xml;
        }
 
@@ -403,6 +405,7 @@ class UcdXmlReader {
                while ( $this->xml->moveToNextAttribute() ) {
                        $attrs[$this->xml->name] = $this->xml->value;
                }
+
                return $attrs;
        }
 
@@ -447,7 +450,7 @@ class UcdXmlReader {
                }
 
                $xml = $this->open();
-               while ( $xml->name !== 'blocks' && $xml->read() );
+               while ( $xml->name !== 'blocks' && $xml->read() ) ;
 
                while ( $xml->read() ) {
                        if ( $xml->nodeType == XMLReader::ELEMENT ) {
@@ -460,9 +463,9 @@ class UcdXmlReader {
                        }
                }
                $xml->close();
+
                return $this->blocks;
        }
-
 }
 
 $maintClass = 'GenerateCollationData';