Skip to content

Commit 8120aa7

Browse files
committed
Hide possible warnings from serialize
1 parent a517dd4 commit 8120aa7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

html-api-debugger/html-api-integration.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@ function get_normalized_html( string $html, array $options ): ?string {
5050
return null;
5151
}
5252

53-
return $processor->serialize();
53+
// Ignore warnings from serialization.
54+
// phpcs:ignore WordPress.PHP.DevelopmentFunctions
55+
set_error_handler( function () { }, E_USER_WARNING );
56+
$result = $processor->serialize();
57+
restore_error_handler();
58+
return $result;
5459
}
5560

5661
/**

0 commit comments

Comments
 (0)