diff --git a/Model/Resolver/AddressDetails.php b/Model/Resolver/AddressDetails.php index 1c16a52..f336c82 100644 --- a/Model/Resolver/AddressDetails.php +++ b/Model/Resolver/AddressDetails.php @@ -29,12 +29,9 @@ class AddressDetails implements ResolverInterface * @param Settings $helper */ public function __construct( - StoreConfigHelper $helper + PostcodeApiClient $postcodeHelper ) { - $this->postcodeHelper = new PostcodeApiClient( - $helper->getValue(StoreConfigHelper::PATH['api_key']), - $helper->getValue(StoreConfigHelper::PATH['api_secret']) - ); + $this->postcodeHelper = $postcodeHelper; } /** diff --git a/Model/Resolver/Autocomplete.php b/Model/Resolver/Autocomplete.php index eeeab85..75de994 100644 --- a/Model/Resolver/Autocomplete.php +++ b/Model/Resolver/Autocomplete.php @@ -39,13 +39,10 @@ class Autocomplete implements ResolverInterface * @param Settings $helper */ public function __construct( - StoreConfigHelper $helper, + PostcodeApiClient $postcodeHelper, CountryInformationAcquirerInterface $countryInterface ) { - $this->postcodeHelper = new PostcodeApiClient( - $helper->getValue(StoreConfigHelper::PATH['api_key']), - $helper->getValue(StoreConfigHelper::PATH['api_secret']) - ); + $this->postcodeHelper = $postcodeHelper; $this->countryInterface = $countryInterface; } diff --git a/Model/Resolver/Postcode.php b/Model/Resolver/Postcode.php index 3d8a751..2facfaf 100644 --- a/Model/Resolver/Postcode.php +++ b/Model/Resolver/Postcode.php @@ -33,12 +33,9 @@ class Postcode implements ResolverInterface * @param PostcodeApiClient $postcodeHelper */ public function __construct( - StoreConfigHelper $helper + PostcodeApiClient $postcodeHelper ) { - $this->postcodeHelper = new PostcodeApiClient( - $helper->getValue(StoreConfigHelper::PATH['api_key']), - $helper->getValue(StoreConfigHelper::PATH['api_secret']) - ); + $this->postcodeHelper = $postcodeHelper; } /**