Add return type

This commit is contained in:
Emili Castells Guasch 2024-11-04 16:34:29 +01:00
parent 1a5003770f
commit e63e747f66
2 changed files with 2 additions and 2 deletions

View file

@ -170,7 +170,7 @@ class ApplepayModule implements ServiceModule, ExtendingModule, ExecutableModule
add_filter(
'woocommerce_paypal_payments_selected_button_locations',
function( array $locations, string $setting_name ) {
function( array $locations, string $setting_name ): array {
$gateway = WC()->payment_gateways()->payment_gateways()[ ApplePayGateway::ID ] ?? '';
if ( $gateway && $gateway->enabled === 'yes' && $setting_name === 'smart_button_locations' ) {
$locations[] = 'checkout';

View file

@ -220,7 +220,7 @@ class GooglepayModule implements ServiceModule, ExtendingModule, ExecutableModul
add_filter(
'woocommerce_paypal_payments_selected_button_locations',
function( array $locations, string $setting_name ) {
function( array $locations, string $setting_name ): array {
$gateway = WC()->payment_gateways()->payment_gateways()[ GooglePayGateway::ID ] ?? '';
if ( $gateway && $gateway->enabled === 'yes' && $setting_name === 'smart_button_locations' ) {
$locations[] = 'checkout';