From 0947b0fb8309ad451145fa6a3af5ac61c3319d52 Mon Sep 17 00:00:00 2001 From: Alex Pott <alex.a.pott@googlemail.com> Date: Thu, 22 May 2014 14:11:36 +0100 Subject: [PATCH] Issue #2246657 by tstoeckler, YesCT: $options is misnamed in Language::__construct() should be property values. --- core/lib/Drupal/Core/Language/Language.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/core/lib/Drupal/Core/Language/Language.php b/core/lib/Drupal/Core/Language/Language.php index 45759837d0ea..9bfc10be33de 100644 --- a/core/lib/Drupal/Core/Language/Language.php +++ b/core/lib/Drupal/Core/Language/Language.php @@ -91,22 +91,23 @@ class Language implements LanguageInterface { /** * Constructs a new class instance. * - * @param array $options - * The properties used to construct the language. + * @param array $values + * An array of property values, keyed by property name, used to construct + * the language. */ - public function __construct(array $options = array()) { + public function __construct(array $values = array()) { // Set all the provided properties for the language. - foreach ($options as $name => $value) { - $this->{$name} = $value; + foreach ($values as $key => $value) { + $this->{$key} = $value; } - // If some options were not set, set sane defaults of a predefined language. - if (!isset($options['name']) || !isset($options['direction'])) { + // If some values were not set, set sane defaults of a predefined language. + if (!isset($values['name']) || !isset($values['direction'])) { $predefined = LanguageManager::getStandardLanguageList(); if (isset($predefined[$this->id])) { - if (!isset($options['name'])) { + if (!isset($values['name'])) { $this->name = $predefined[$this->id][0]; } - if (!isset($options['direction']) && isset($predefined[$this->id][2])) { + if (!isset($values['direction']) && isset($predefined[$this->id][2])) { $this->direction = $predefined[$this->id][2]; } } -- GitLab