public function __construct() {
parent::__construct();
- $this->mDescription = 'Generate Utf8Case.ser from the Unicode Character Database ' .
- 'and supplementary files';
+ $this->addDescription( 'Generate Utf8Case.ser from the Unicode Character Database ' .
+ 'and supplementary files' );
$this->addOption( 'unicode-data-file', 'The local location of the data file ' .
'from http://unicode.org/Public/UNIDATA/UnicodeData.txt', false, true );
}
}
// For the file format, see http://www.unicode.org/reports/tr44/
- $fieldNames = array(
+ $fieldNames = [
'Code',
'Name',
'General_Category',
'Simple_Uppercase_Mapping',
'Simple_Lowercase_Mapping',
'Simple_Titlecase_Mapping'
- );
+ ];
- $upper = array();
- $lower = array();
+ $upper = [];
+ $lower = [];
$lineNum = 0;
while ( false !== ( $line = fgets( $file ) ) ) {
# Split fields
$numberedData = explode( ';', $line );
- $data = array();
+ $data = [];
foreach ( $fieldNames as $number => $name ) {
$data[$name] = $numberedData[$number];
}
}
global $IP;
- file_put_contents( "$IP/serialized/Utf8Case.ser", serialize( array(
+ file_put_contents( "$IP/serialized/Utf8Case.ser", serialize( [
'wikiUpperChars' => $upper,
'wikiLowerChars' => $lower,
- ) ) );
+ ] ) );
}
}