fixed type and changed property name

This commit is contained in:
Daniel Hüsken 2024-12-18 09:20:08 +01:00
parent eb2298fcae
commit a225043b3d
No known key found for this signature in database
GPG key ID: 9F732DA37FA709E8
2 changed files with 7 additions and 7 deletions

View file

@ -30,7 +30,7 @@ return array(
},
'save-payment-methods.supported-countries' => static function ( ContainerInterface $container ) : array {
if ( has_filter( 'woocommerce_paypal_payments_save_payment_methods_supported_country_currency_matrix' ) ) {
_deprecated_hook( 'woocommerce_paypal_payments_save_payment_methods_supported_country_currency_matrix', '3.0.0', 'woocommerce_paypal_payments_save_payment_methods_supported_countries', esc_attr__( 'Please use the new Hook to filer countries for saved payments in PayPal Payments.', 'woocommerce-paypal-payments' ) );
_deprecated_hook( 'woocommerce_paypal_payments_save_payment_methods_supported_country_currency_matrix', '3.0.0', 'woocommerce_paypal_payments_save_payment_methods_supported_countries', esc_attr__( 'Please use the new Hook to filter countries for saved payments in PayPal Payments.', 'woocommerce-paypal-payments' ) );
}
return apply_filters(

View file

@ -19,7 +19,7 @@ class SavePaymentMethodsApplies {
*
* @var array
*/
private array $allowed_country_currencies;
private array $allowed_countries;
/**
* 2-letter country code of the shop.
@ -31,15 +31,15 @@ class SavePaymentMethodsApplies {
/**
* SavePaymentMethodsApplies constructor.
*
* @param array $allowed_country_currencies The matrix which countries and currency combinations can be used for Save Payment Methods.
* @param array $allowed_countries The matrix which countries and currency combinations can be used for Save Payment Methods.
* @param string $country 2-letter country code of the shop.
*/
public function __construct(
array $allowed_country_currencies,
array $allowed_countries,
string $country
) {
$this->allowed_country_currencies = $allowed_country_currencies;
$this->country = $country;
$this->allowed_countries = $allowed_countries;
$this->country = $country;
}
/**
@ -49,6 +49,6 @@ class SavePaymentMethodsApplies {
*/
public function for_country(): bool {
return in_array( $this->country, $this->allowed_country_currencies, true );
return in_array( $this->country, $this->allowed_countries, true );
}
}