DefaultCountryResolver.php in Price 2.x
File
src/Resolver/DefaultCountryResolver.php
View source
<?php
namespace Drupal\price\Resolver;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\price\Country;
class DefaultCountryResolver implements CountryResolverInterface {
protected $configFactory;
public function __construct(ConfigFactoryInterface $config_factory) {
$this->configFactory = $config_factory;
}
public function resolve() {
$country_code = $this->configFactory
->get('system.date')
->get('country.default');
return new Country($country_code);
}
}