diff --git a/lib/internal/Magento/Framework/Locale/Resolver.php b/lib/internal/Magento/Framework/Locale/Resolver.php index 3a516fcea5e91..83637dac9c475 100644 --- a/lib/internal/Magento/Framework/Locale/Resolver.php +++ b/lib/internal/Magento/Framework/Locale/Resolver.php @@ -64,16 +64,19 @@ class Resolver implements ResolverInterface * @param string $defaultLocalePath * @param string $scopeType * @param mixed $locale + * @param DeploymentConfig|null $deploymentConfig */ public function __construct( ScopeConfigInterface $scopeConfig, $defaultLocalePath, $scopeType, - $locale = null + $locale = null, + DeploymentConfig $deploymentConfig = null ) { $this->scopeConfig = $scopeConfig; $this->defaultLocalePath = $defaultLocalePath; $this->scopeType = $scopeType; + $this->deploymentConfig = $deploymentConfig ?: ObjectManager::getInstance()->create(DeploymentConfig::class); $this->setLocale($locale); } @@ -101,7 +104,7 @@ public function getDefaultLocale() { if (!$this->defaultLocale) { $locale = false; - if ($this->getDeploymentConfig()->isAvailable() && $this->getDeploymentConfig()->isDbAvailable()) { + if ($this->deploymentConfig->isAvailable() && $this->deploymentConfig->isDbAvailable()) { $locale = $this->scopeConfig->getValue($this->getDefaultLocalePath(), $this->scopeType); } if (!$locale) { @@ -169,18 +172,4 @@ public function revert() } return $result; } - - /** - * Retrieve Deployment Config - * - * @return DeploymentConfig - */ - private function getDeploymentConfig() - { - if (!$this->deploymentConfig) { - $this->deploymentConfig = ObjectManager::getInstance()->get(DeploymentConfig::class); - } - - return $this->deploymentConfig; - } }