diff --git a/modules/ppcp-compat/src/PPEC/PPECHelper.php b/modules/ppcp-compat/src/PPEC/PPECHelper.php index 0f13aafe5..ec1543b70 100644 --- a/modules/ppcp-compat/src/PPEC/PPECHelper.php +++ b/modules/ppcp-compat/src/PPEC/PPECHelper.php @@ -44,7 +44,12 @@ class PPECHelper { * @return bool */ public static function is_gateway_available() { - return self::is_plugin_active() && is_callable( 'wc_gateway_ppec' ) && wc_gateway_ppec()->settings->get_active_api_credentials(); + if ( ! self::is_plugin_active() || ! is_callable( 'wc_gateway_ppec' ) ) { + return false; + } + + $ppec = wc_gateway_ppec(); + return is_object( $ppec ) && $ppec->settings && $ppec->settings->get_active_api_credentials(); } /** diff --git a/psalm-baseline.xml b/psalm-baseline.xml index e2aa3df83..0ad53d8d5 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,5 +1,5 @@ - + PAYPAL_API_URL @@ -67,9 +67,6 @@ - - $response - wc_print_r( $args['body'], true ) wc_print_r( $response['body'], true ) @@ -99,26 +96,6 @@ to_array - - - $discount - $handling - $insurance - $item_total - $shipping - $shipping_discount - $tax_total - - - $this->discount - $this->handling - $this->insurance - $this->item_total - $this->shipping - $this->shipping_discount - $this->tax_total - - to_array @@ -257,11 +234,6 @@ (int) $item->get_quantity() - - - $needs_update - - $national_number @@ -355,14 +327,9 @@ card card - - $order - - - process_checkout_form - process_checkout_form_when_creating_account + set_bn_code validate_paynow_form @@ -445,11 +412,6 @@ NoteTraits - - - wc_gateway_ppec() - - wc_gateway_ppec() @@ -639,9 +601,6 @@ getKey - - EP_PAGES - @@ -677,7 +636,7 @@ - + phone phone phone @@ -706,9 +665,6 @@ wp_unslash( $_GET['token'] ) - - $order -