From a3440b82f35c0eb8cca8a3020fc75494aff95d1b Mon Sep 17 00:00:00 2001 From: Emili Castells Guasch Date: Tue, 13 Feb 2024 14:57:08 +0100 Subject: [PATCH] Fix psalm --- .../src/Helper/RealTimeAccountUpdaterHelper.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/ppcp-save-payment-methods/src/Helper/RealTimeAccountUpdaterHelper.php b/modules/ppcp-save-payment-methods/src/Helper/RealTimeAccountUpdaterHelper.php index 062a18f2d..1353b9a53 100644 --- a/modules/ppcp-save-payment-methods/src/Helper/RealTimeAccountUpdaterHelper.php +++ b/modules/ppcp-save-payment-methods/src/Helper/RealTimeAccountUpdaterHelper.php @@ -9,8 +9,8 @@ declare(strict_types=1); namespace WooCommerce\PayPalCommerce\SavePaymentMethods\Helper; -use stdClass; use WC_Payment_Token; +use WC_Payment_Token_CC; /** * Class RealTimeAccountUpdaterHelper @@ -25,7 +25,8 @@ class RealTimeAccountUpdaterHelper { */ public function update_wc_card_token( string $expiry, string $last_digits, WC_Payment_Token $token ): void { if ( - $token->get_type() !== 'CC' + ! is_a( $token, WC_Payment_Token_CC::class ) + || $token->get_type() !== 'CC' || ! in_array( $token->get_card_type(), array( 'VISA', 'MASTERCARD' ), true ) ) { return;