summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/Translate/scripts/yaml-tests.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/extensions/Translate/scripts/yaml-tests.php')
-rw-r--r--www/wiki/extensions/Translate/scripts/yaml-tests.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/www/wiki/extensions/Translate/scripts/yaml-tests.php b/www/wiki/extensions/Translate/scripts/yaml-tests.php
index 07f8b39e..a1f9d961 100644
--- a/www/wiki/extensions/Translate/scripts/yaml-tests.php
+++ b/www/wiki/extensions/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 );
@@ -92,5 +92,5 @@ class YamlTests extends Maintenance {
}
}
-$maintClass = 'YamlTests';
+$maintClass = YamlTests::class;
require_once RUN_MAINTENANCE_IF_MAIN;