diff options
Diffstat (limited to 'MLEB/Translate/scripts/yaml-tests.php')
-rw-r--r-- | MLEB/Translate/scripts/yaml-tests.php | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/MLEB/Translate/scripts/yaml-tests.php b/MLEB/Translate/scripts/yaml-tests.php index 905b8a71..c0bd3dee 100644 --- a/MLEB/Translate/scripts/yaml-tests.php +++ b/MLEB/Translate/scripts/yaml-tests.php @@ -5,7 +5,7 @@ * @author Niklas Laxström * * @copyright Copyright © 2010, Niklas Laxström - * @license GPL-2.0+ + * @license GPL-2.0-or-later * @file */ @@ -26,17 +26,17 @@ class YamlTests extends Maintenance { public function execute() { global $wgTranslateGroupFiles, $wgTranslateYamlLibrary; - $documents = array(); - $times = array(); - $mems = array(); - $mempeaks = array(); + $documents = []; + $times = []; + $mems = []; + $mempeaks = []; - foreach ( array( 'syck', 'spyc', 'phpyaml' ) as $driver ) { + foreach ( [ 'syck', 'spyc', 'phpyaml' ] as $driver ) { $mempeaks[$driver] = -memory_get_peak_usage( true ); $mems[$driver] = -memory_get_usage( true ); $times[$driver] = -microtime( true ); $wgTranslateYamlLibrary = $driver; - $documents[$driver] = array(); + $documents[$driver] = []; foreach ( $wgTranslateGroupFiles as $file ) { foreach ( self::parseGroupFile( $file ) as $id => $docu ) { $documents[$driver]["$file-$id"] = $docu; @@ -59,7 +59,7 @@ class YamlTests extends Maintenance { public static function parseGroupFile( $filename ) { $data = file_get_contents( $filename ); $documents = preg_split( "/^---$/m", $data, -1, PREG_SPLIT_NO_EMPTY ); - $groups = array(); + $groups = []; $template = false; foreach ( $documents as $document ) { $document = TranslateYaml::loadString( $document ); @@ -67,7 +67,7 @@ class YamlTests extends Maintenance { $template = $document['TEMPLATE']; } else { if ( !isset( $document['BASIC']['id'] ) ) { - trigger_error( "No path ./BASIC/id (group id not defined) " . + trigger_error( 'No path ./BASIC/id (group id not defined) ' . "in yaml document located in $filename" ); continue; } @@ -76,7 +76,7 @@ class YamlTests extends Maintenance { } foreach ( $groups as $i => $group ) { - $groups[$i] = TranslateYaml::mergeTemplate( $template, $group ); + $groups[$i] = MessageGroupConfigurationParser::mergeTemplate( $template, $group ); } return $groups; |