WordPress/wp-includes/html-api
dmsnell 011d45abbc HTML API: Add sentinels for unreachable code.
There are places in the HTML API code where some tools get confused and flag invalid types for the return of a function because they are unable to detect that the end of the function is unreachable.

Since PHP doesn't provide a way to encode total matching in the source code, this patch adds a few extra lines in those unreachable locations to satisfy any tooling which isn't able to fully analyze the code.

Additionally this serves as extra guarding in case someone changes these functions in a way which would break them and the existing test suite doesn't catch those breakages.

Developed in https://github.com/WordPress/wordpress-develop/pull/7315
Discussed in https://core.trac.wordpress.org/ticket/62018

Props dlh, dmsnell.
Fixes #62018.

Built from https://develop.svn.wordpress.org/trunk@59001


git-svn-id: http://core.svn.wordpress.org/trunk@58397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-09-09 22:12:15 +00:00
..
class-wp-html-active-formatting-elements.php HTML API: Add missing tags in IN BODY insertion mode to HTML Processor. 2024-07-22 22:24:15 +00:00
class-wp-html-attribute-token.php HTML API: Track spans of text with (offset, length) instead of (start, end). 2023-12-10 13:19:28 +00:00
class-wp-html-decoder.php HTML API: Add missing `@global` tag on HTML Decoder. 2024-09-02 20:55:14 +00:00
class-wp-html-doctype-info.php HTML API: Parse DOCTYPE tokens and set HTML parser mode accordingly. 2024-08-23 14:55:15 +00:00
class-wp-html-open-elements.php HTML API: Only examine HTML nodes in `pop_until()` instack of open elements. 2024-09-04 19:25:14 +00:00
class-wp-html-processor-state.php HTML API: Respect document compat mode when handling CSS class names. 2024-09-04 04:34:15 +00:00
class-wp-html-processor.php HTML API: Add sentinels for unreachable code. 2024-09-09 22:12:15 +00:00
class-wp-html-span.php HTML API: Add PHP type annotations. 2024-07-19 23:44:16 +00:00
class-wp-html-stack-event.php HTML API: Add PHP type annotations. 2024-07-19 23:44:16 +00:00
class-wp-html-tag-processor.php HTML API: Add sentinels for unreachable code. 2024-09-09 22:12:15 +00:00
class-wp-html-text-replacement.php HTML API: Add PHP type annotations. 2024-07-19 23:44:16 +00:00
class-wp-html-token.php HTML API: Add support for SVG and MathML (Foreign content) 2024-08-08 07:25:15 +00:00
class-wp-html-unsupported-exception.php HTML API: Add context to Unsupported_Exception class for improved debugging. 2024-07-12 22:29:13 +00:00
html5-named-character-references.php Introduce Token Map: An optimized static translation class. 2024-05-23 19:56:08 +00:00