summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/Translate/ffs/AmdFFS.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/extensions/Translate/ffs/AmdFFS.php')
-rw-r--r--www/wiki/extensions/Translate/ffs/AmdFFS.php28
1 files changed, 14 insertions, 14 deletions
diff --git a/www/wiki/extensions/Translate/ffs/AmdFFS.php b/www/wiki/extensions/Translate/ffs/AmdFFS.php
index 7b40bd84..bd759e8f 100644
--- a/www/wiki/extensions/Translate/ffs/AmdFFS.php
+++ b/www/wiki/extensions/Translate/ffs/AmdFFS.php
@@ -17,7 +17,7 @@
* "key2": "anothervalue"
* });
*
- * It also supports the the top-level bundle with a root construction and language indicators.
+ * It also supports the top-level bundle with a root construction and language indicators.
* The following example will give the same messages as above:
* define({
* "root": {
@@ -34,7 +34,7 @@
* @file
* @author Matthias Palmér
* @copyright Copyright © 2011-2015, MetaSolutions AB
- * @license GPL-2.0+
+ * @license GPL-2.0-or-later
*/
/**
@@ -51,23 +51,23 @@ class AmdFFS extends SimpleFFS {
* @return bool
*/
public static function isValid( $data ) {
- $data = AmdFFS::extractMessagePart( $data );
+ $data = self::extractMessagePart( $data );
return is_array( FormatJson::decode( $data, /*as array*/true ) );
}
public function getFileExtensions() {
- return array( '.js' );
+ return [ '.js' ];
}
/**
- * @param array $data
+ * @param string $data
* @return array Parsed data.
*/
public function readFromVariable( $data ) {
- $authors = AmdFFS::extractAuthors( $data );
- $data = AmdFFS::extractMessagePart( $data );
- $messages = (array) FormatJson::decode( $data, /*as array*/true );
- $metadata = array();
+ $authors = self::extractAuthors( $data );
+ $data = self::extractMessagePart( $data );
+ $messages = (array)FormatJson::decode( $data, /*as array*/true );
+ $metadata = [];
// Take care of regular language bundles, as well as the root bundle.
if ( isset( $messages['root'] ) ) {
@@ -76,11 +76,11 @@ class AmdFFS extends SimpleFFS {
$messages = $this->group->getMangler()->mangle( $messages );
}
- return array(
+ return [
'MESSAGES' => $messages,
'AUTHORS' => $authors,
'METADATA' => $metadata,
- );
+ ];
}
/**
@@ -88,7 +88,7 @@ class AmdFFS extends SimpleFFS {
* @return string
*/
protected function writeReal( MessageCollection $collection ) {
- $messages = array();
+ $messages = [];
$mangler = $this->group->getMangler();
/** @var ThinMessage $m */
@@ -159,11 +159,11 @@ EOT;
}
/**
- * @param array $authors
+ * @param string[] $authors
* @return string
*/
private function authorsList( array $authors ) {
- if ( count( $authors ) === 0 ) {
+ if ( $authors === [] ) {
return '';
}