Suppress WP_HTML_Tag_Processor Psalm error as the class exists

This commit is contained in:
Daniel Dudzic 2024-04-10 20:43:30 +02:00
parent 0e4ef8b64a
commit 1025df779f
No known key found for this signature in database
GPG key ID: 31B40D33E3465483

View file

@ -12,7 +12,6 @@ declare(strict_types=1);
namespace WooCommerce\PayPalCommerce\PayLaterBlock;
use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
use WP_HTML_Tag_Processor;
/**
* Class PayLaterBlockRenderer
@ -31,7 +30,12 @@ class PayLaterBlockRenderer {
$html = '<div id="' . esc_attr( $attributes['id'] ?? '' ) . '" class="ppcp-messages" data-partner-attribution-id="Woo_PPCP"></div>';
$processor = new WP_HTML_Tag_Processor( $html );
/**
* Class exist in WordPress.
*
* @psalm-suppress UndefinedClass
*/
$processor = new \WP_HTML_Tag_Processor( $html );
if ( $processor->next_tag( 'div' ) ) {
$layout = $attributes['layout'] ?? 'text';