From 33cda6101794c360ff81821f0ecd2aff5ac01dc5 Mon Sep 17 00:00:00 2001 From: Emili Castells Guasch Date: Wed, 2 Aug 2023 16:08:46 +0200 Subject: [PATCH] Fix psalm --- modules/ppcp-wc-gateway/src/Gateway/OXXO/OXXO.php | 6 ++++++ .../src/Gateway/PayUponInvoice/PayUponInvoice.php | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/modules/ppcp-wc-gateway/src/Gateway/OXXO/OXXO.php b/modules/ppcp-wc-gateway/src/Gateway/OXXO/OXXO.php index fc91f370e..d21bd9cc2 100644 --- a/modules/ppcp-wc-gateway/src/Gateway/OXXO/OXXO.php +++ b/modules/ppcp-wc-gateway/src/Gateway/OXXO/OXXO.php @@ -155,6 +155,12 @@ class OXXO { add_action( 'add_meta_boxes', function( string $post_type ) { + /** + * Class and function exist in WooCommerce. + * + * @psalm-suppress UndefinedClass + * @psalm-suppress UndefinedFunction + */ $screen = wc_get_container()->get( CustomOrdersTableController::class )->custom_orders_table_usage_is_enabled() ? wc_get_page_screen_id( 'shop-order' ) : 'shop_order'; diff --git a/modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PayUponInvoice.php b/modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PayUponInvoice.php index fc4dc8696..971497804 100644 --- a/modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PayUponInvoice.php +++ b/modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PayUponInvoice.php @@ -513,6 +513,12 @@ class PayUponInvoice { add_action( 'add_meta_boxes', function( string $post_type ) { + /** + * Class and function exist in WooCommerce. + * + * @psalm-suppress UndefinedClass + * @psalm-suppress UndefinedFunction + */ $screen = wc_get_container()->get( CustomOrdersTableController::class )->custom_orders_table_usage_is_enabled() ? wc_get_page_screen_id( 'shop-order' ) : 'shop_order';