summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'MLEB/Translate/MessageGroupConfigurationParser.php')
-rw-r--r--MLEB/Translate/MessageGroupConfigurationParser.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/MLEB/Translate/MessageGroupConfigurationParser.php b/MLEB/Translate/MessageGroupConfigurationParser.php
index 48870836..d86f2565 100644
--- a/MLEB/Translate/MessageGroupConfigurationParser.php
+++ b/MLEB/Translate/MessageGroupConfigurationParser.php
@@ -3,7 +3,7 @@
*
* @file
* @author Niklas Laxström
- * @license GPL-2.0+
+ * @license GPL-2.0-or-later
*/
/**
@@ -25,7 +25,7 @@ class MessageGroupConfigurationParser {
* schema will be ignored, if schema validation is enabled.
*
* @param string $data Yaml
- * @param callable $callback Optional callback which is called on errors. Parameters are
+ * @param callable|null $callback Optional callback which is called on errors. Parameters are
* document index, processed configuration and error message.
* @return array Group configurations indexed by message group id.
*/
@@ -38,7 +38,7 @@ class MessageGroupConfigurationParser {
$documents = self::getDocumentsFromYaml( $data );
$configurations = self::parseDocuments( $documents );
- $groups = array();
+ $groups = [];
if ( is_array( $this->baseSchema ) ) {
foreach ( $configurations as $index => $config ) {
@@ -76,12 +76,13 @@ class MessageGroupConfigurationParser {
* Returns group configurations from YAML documents. If there is document containing template,
* it will be merged with other configurations.
*
- * @param string $data
+ * @param array $documents
* @return array Unvalidated group configurations
*/
public function parseDocuments( array $documents ) {
- $groups = array();
- $template = false;
+ $groups = [];
+ $template = [];
+
foreach ( $documents as $document ) {
$document = TranslateYaml::loadString( $document );
@@ -129,7 +130,7 @@ class MessageGroupConfigurationParser {
continue;
}
- $extra = call_user_func( array( $class, 'getExtraSchema' ) );
+ $extra = call_user_func( [ $class, 'getExtraSchema' ] );
$schema = array_replace_recursive( $schema, $extra );
}