Merge "Hard deprecate $wgTidyConfig['driver'] = 'disabled'"
[lhc/web/wiklou.git] / maintenance / language / generateCollationData.php
index 32adafd..210e907 100644 (file)
@@ -247,11 +247,7 @@ class GenerateCollationData extends Maintenance {
                        if ( $weight !== $prevWeight ) {
                                $this->groups[$prevWeight] = $group;
                                $prevWeight = $weight;
-                               if ( isset( $this->groups[$weight] ) ) {
-                                       $group = $this->groups[$weight];
-                               } else {
-                                       $group = [];
-                               }
+                               $group = $this->groups[$weight] ?? [];
                        }
                        $group[] = $cp;
                }
@@ -263,7 +259,7 @@ class GenerateCollationData extends Maintenance {
                // character has a longer primary weight sequence with an initial
                // portion equal to the first character, then remove the second
                // character. This avoids having characters like U+A732 (double A)
-               // polluting the basic latin sort area.
+               // polluting the basic Latin sort area.
 
                foreach ( $this->groups as $weight => $group ) {
                        if ( preg_match( '/(\.[0-9A-F]*)\./', $weight, $m ) ) {
@@ -321,9 +317,10 @@ class GenerateCollationData extends Maintenance {
                print "Out of order: $numOutOfOrder / " . count( $headerChars ) . "\n";
 
                global $IP;
+               $writer = new StaticArrayWriter();
                file_put_contents(
                        "$IP/includes/collation/data/first-letters-root.php",
-                       wfMakeStaticArrayFile( $headerChars, 'File created by generateCollationData.php' )
+                       $writer->create( $headerChars, 'File created by generateCollationData.php' )
                );
                echo "first-letters-root: file written.\n";
        }