You are here

public function DefaultCountryResolver::resolve in Commerce Core 8.2

Resolves the country.

Return value

\Drupal\commerce\Country|null The country object, if resolved. Otherwise NULL, indicating that the next resolver in the chain should be called.

Overrides CountryResolverInterface::resolve

File

src/Resolver/DefaultCountryResolver.php, line 33

Class

DefaultCountryResolver
Returns the site's default country.

Namespace

Drupal\commerce\Resolver

Code

public function resolve() {
  $country_code = $this->configFactory
    ->get('system.date')
    ->get('country.default');
  return new Country($country_code);
}