diff options
Diffstat (limited to 'MLEB/Translate/ffs/JavaFFS.php')
-rw-r--r-- | MLEB/Translate/ffs/JavaFFS.php | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/MLEB/Translate/ffs/JavaFFS.php b/MLEB/Translate/ffs/JavaFFS.php index 227d27df..87d9b1bd 100644 --- a/MLEB/Translate/ffs/JavaFFS.php +++ b/MLEB/Translate/ffs/JavaFFS.php @@ -15,13 +15,13 @@ class JavaFFS extends SimpleFFS implements MetaYamlSchemaExtender { } public function getFileExtensions() { - return array( '.properties' ); + return [ '.properties' ]; } protected $keySeparator = '='; /** - * @param $group FileBasedMessageGroup + * @param FileBasedMessageGroup $group */ public function __construct( FileBasedMessageGroup $group ) { parent::__construct( $group ); @@ -34,14 +34,14 @@ class JavaFFS extends SimpleFFS implements MetaYamlSchemaExtender { // READ /** - * @param $data array + * @param string $data * @return array Parsed data. * @throws MWException */ public function readFromVariable( $data ) { $data = self::fixNewLines( $data ); $lines = array_map( 'ltrim', explode( "\n", $data ) ); - $authors = $messages = array(); + $authors = $messages = []; $linecontinuation = false; $key = ''; @@ -58,7 +58,7 @@ class JavaFFS extends SimpleFFS implements MetaYamlSchemaExtender { } if ( $line[0] === '#' || $line[0] === '!' ) { - $match = array(); + $match = []; $ok = preg_match( '/#\s*Author:\s*(.*)/', $line, $match ); if ( $ok ) { @@ -89,16 +89,16 @@ class JavaFFS extends SimpleFFS implements MetaYamlSchemaExtender { $messages = $this->group->getMangler()->mangle( $messages ); - return array( + return [ 'AUTHORS' => $authors, 'MESSAGES' => $messages, - ); + ]; } // Write /** - * @param $collection MessageCollection + * @param MessageCollection $collection * @return string */ protected function writeReal( MessageCollection $collection ) { @@ -212,11 +212,11 @@ class JavaFFS extends SimpleFFS implements MetaYamlSchemaExtender { $value = ltrim( $value ); $value = str_replace( '\n', "\n", $value ); - return array( $key, $value ); + return [ $key, $value ]; } /** - * @param $collection MessageCollection + * @param MessageCollection $collection * @return string */ protected function doHeader( MessageCollection $collection ) { @@ -236,7 +236,7 @@ class JavaFFS extends SimpleFFS implements MetaYamlSchemaExtender { } /** - * @param $collection MessageCollection + * @param MessageCollection $collection * @return string */ protected function doAuthors( MessageCollection $collection ) { @@ -252,24 +252,24 @@ class JavaFFS extends SimpleFFS implements MetaYamlSchemaExtender { } public static function getExtraSchema() { - $schema = array( - 'root' => array( + $schema = [ + 'root' => [ '_type' => 'array', - '_children' => array( - 'FILES' => array( + '_children' => [ + 'FILES' => [ '_type' => 'array', - '_children' => array( - 'header' => array( + '_children' => [ + 'header' => [ '_type' => 'text', - ), - 'keySeparator' => array( + ], + 'keySeparator' => [ '_type' => 'text', - ), - ) - ) - ) - ) - ); + ], + ] + ] + ] + ] + ]; return $schema; } |