scopeResolver = $scopeResolver; $this->areaCode = $areaCode; } /** * {@inheritdoc} */ public function getScope($scopeId = null) { $scope = $this->scopeResolver->getScope($scopeId); if (!$scope instanceof \Magento\Framework\Url\ScopeInterface) { throw new \Magento\Framework\Exception\LocalizedException( new \Magento\Framework\Phrase('The scope object is invalid. Verify the scope object and try again.') ); } return $scope; } /** * Retrieve array of URL scopes. * * @return \Magento\Framework\Url\ScopeInterface[] */ public function getScopes() { return $this->scopeResolver->getScopes(); } /** * {@inheritdoc} */ public function getAreaCode() { return $this->areaCode; } }