diff --git a/includes/blocks/class-yoone-blocks-moneris.php b/includes/blocks/class-yoone-blocks-moneris.php index 0c0bd18..66c0c9b 100644 --- a/includes/blocks/class-yoone-blocks-moneris.php +++ b/includes/blocks/class-yoone-blocks-moneris.php @@ -42,7 +42,10 @@ function yoone_moneris_store_payment_data($order, $result, $request) { // Only declare the Blocks payment method class when the Blocks base type exists to prevent type resolution issues. if (class_exists('Automattic\WooCommerce\Blocks\Payments\PaymentMethodType') && ! class_exists('Yoone_Moneris_Blocks_Payment_Method')) { - class Yoone_Moneris_Blocks_Payment_Method extends Automattic\WooCommerce\Blocks\Payments\PaymentMethodType { + /** + * 使用 use 导入基类,避免 IDE 报 Undefined type + */ +class Yoone_Moneris_Blocks_Payment_Method extends Automattic\WooCommerce\Blocks\Payments\PaymentMethodType { /** * Unique name of the payment method in Blocks. * This MUST match the gateway id used by WooCommerce (yoone_moneris). diff --git a/includes/blocks/ide-stub-wc-blocks.php b/includes/blocks/ide-stub-wc-blocks.php new file mode 100644 index 0000000..6dcd559 --- /dev/null +++ b/includes/blocks/ide-stub-wc-blocks.php @@ -0,0 +1,34 @@ +