Merge "auth: Follow up on e907d4328dc3e"
[lhc/web/wiklou.git] / maintenance / language / generateCollationData.php
index a105920..f43d75f 100644 (file)
@@ -202,7 +202,7 @@ class GenerateCollationData extends Maintenance {
                // For each character with an entry in allkeys.txt, overwrite the implicit
                // entry in $this->weights that came from the UCD.
                // Also gather a list of tertiary weights, for use in selecting the group header
-               while ( false !== ( $line = fgets( $file ) ) ) {
+               while ( ( $line = fgets( $file ) ) !== false ) {
                        // We're only interested in single-character weights, pick them out with a regex
                        $line = trim( $line );
                        if ( !preg_match( '/^([0-9A-F]+)\s*;\s*([^#]*)/', $line, $m ) ) {
@@ -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;
                }