diff --git a/core/modules/language/src/ConfigurableLanguageManager.php b/core/modules/language/src/ConfigurableLanguageManager.php index 29ace9e..5c250dd 100644 --- a/core/modules/language/src/ConfigurableLanguageManager.php +++ b/core/modules/language/src/ConfigurableLanguageManager.php @@ -93,9 +93,13 @@ class ConfigurableLanguageManager extends LanguageManager implements Configurabl * An array of language-types currently being initialized, keyed by language- * type. * - * @var array + * @var bool[] + * An array of which the keys are language type names, and values are + * booleans indicating whether or not the language for that type is + * currently being initialized. If a language type is missing, it is + * currently not being initialized. */ - protected $initializing = array(); + protected $initializing = []; /** * {@inheritdoc} @@ -217,13 +221,12 @@ public function getCurrentLanguage($type = LanguageInterface::TYPE_INTERFACE) { if (empty($this->initializing[$type])) { // Set a flag indicating that we're currently initializing the // language-type to prevent recursive initialization. - $this->initializing[$type] = $type; + $this->initializing[$type] = TRUE; $negotiation = $this->negotiator->initializeType($type); $this->negotiatedLanguages[$type] = reset($negotiation); $this->negotiatedMethods[$type] = key($negotiation); - - unset($this->initializing_type[$type]); + unset($this->initializing[$type]); } // If the current interface language needs to be retrieved during // initialization we return the system language. This way string