X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Flanguage%2FgenerateCollationData.php;h=f43d75f2ea1e9e2508541e557fdc6d75a3cc5212;hb=f310541eda07e43fd13683345cd967685ff2f34a;hp=97b46f730283856fa4ee39893b3c402963cc8050;hpb=a4120368bb7797df25004613feed9406eac1c9d0;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/language/generateCollationData.php b/maintenance/language/generateCollationData.php index 97b46f7302..f43d75f2ea 100644 --- a/maintenance/language/generateCollationData.php +++ b/maintenance/language/generateCollationData.php @@ -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; } @@ -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 ) ) {