summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjaapjan2016-10-26 15:15:28 (GMT)
committerBojan Zivanovic2016-10-26 15:15:28 (GMT)
commit27226463ebbd6477205e33fda36b652b00e461cf (patch)
tree5ad6b320287c01ba5b7553b1905d3ca1b8412364
parentfca16583249cb504a05668948b53984749883193 (diff)
Issue #2822309 by jaapjan: Access level of Drupal\address\Repository\CountryRepository::getDefaultLocale()8.x-1.0-rc3
-rw-r--r--src/Repository/CountryRepository.php24
1 files changed, 5 insertions, 19 deletions
diff --git a/src/Repository/CountryRepository.php b/src/Repository/CountryRepository.php
index efe0643..f49fe15 100644
--- a/src/Repository/CountryRepository.php
+++ b/src/Repository/CountryRepository.php
@@ -23,13 +23,6 @@ class CountryRepository extends ExternalCountryRepository implements ExternalCou
protected $cache;
/**
- * The language manager.
- *
- * @var \Drupal\Core\Language\LanguageManagerInterface
- */
- protected $languageManager;
-
- /**
* Creates a CountryRepository instance.
*
* @param \Drupal\Core\Cache\CacheBackendInterface $cache
@@ -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();
- }
-
}