Commit 27226463 authored by jaapjan's avatar jaapjan Committed by bojanz

Issue #2822309 by jaapjan: Access level of...

Issue #2822309 by jaapjan: Access level of Drupal\address\Repository\CountryRepository::getDefaultLocale()
parent fca16583
......@@ -22,13 +22,6 @@ class CountryRepository extends ExternalCountryRepository implements ExternalCou
*/
protected $cache;
/**
* The language manager.
*
* @var \Drupal\Core\Language\LanguageManagerInterface
*/
protected $languageManager;
/**
* Creates a CountryRepository instance.
*
......@@ -38,10 +31,12 @@ class CountryRepository extends ExternalCountryRepository implements ExternalCou
* The language manager.
*/
public function __construct(CacheBackendInterface $cache, LanguageManagerInterface $language_manager) {
$this->cache = $cache;
$this->languageManager = $language_manager;
parent::__construct();
$this->cache = $cache;
// The getCurrentLanguage() fallback is a workaround for core bug #2684873.
$language = $language_manager->getConfigOverrideLanguage() ?: $language_manager->getCurrentLanguage();
$this->defaultLocale = $language->getId();
}
/**
......@@ -92,13 +87,4 @@ class CountryRepository extends ExternalCountryRepository implements ExternalCou
return $this->baseDefinitions;
}
/**
* {@inheritdoc}
*/
protected function getDefaultLocale() {
// The getCurrentLanguage() fallback is a workaround for core bug #2684873.
$language = $this->languageManager->getConfigOverrideLanguage() ?: $this->languageManager->getCurrentLanguage();
return $language->getId();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment