Commit 47692aac09 for wordpress.org
commit 47692aac09c1954648a2314707ef60bd0afa0ac3
Author: westonruter <westonruter@git.wordpress.org>
Date: Tue Oct 13 17:01:57 2026 +0000
Code Quality: Annotate `WP_HTML_Processor::next_token()` as "impure".
PHPStan infers `WP_HTML_Processor::next_token()` as pure, so the result of `is_tag_closer()` before the matching-closer loop in the block bindings processor's `replace_rich_text()` method survives across the loop, even though each `next_token()` call advances the parser to a different token. The `||` in the check after the loop is then reported as always true, the negation within it as always true, and the code that follows as unreachable. Adding `@phpstan-impure`, as was done for `WP_HTML_Tag_Processor::next_tag()` in r61934 and for `WP_HTML_Tag_Processor::parse_next_tag()` in r63301, resolves all three baselined errors.
This empties the `booleanOr.alwaysTrue` baseline, so the file is removed along with its `includes` entry in `phpstan.neon.dist`.
Developed in https://github.com/WordPress/wordpress-develop/pull/14037.
Follow-up to r61934, r63023, r63301.
Props huzaifaalmesbah, rejaulalomkhan, tstokes8040.
See #65817.
Built from https://develop.svn.wordpress.org/trunk@64335
git-svn-id: http://core.svn.wordpress.org/trunk@63485 1a063a9b-81f0-0310-95a4-ce76da25c4cd
diff --git a/wp-includes/html-api/class-wp-html-processor.php b/wp-includes/html-api/class-wp-html-processor.php
index f6d0d54822..7f871ec9e6 100644
--- a/wp-includes/html-api/class-wp-html-processor.php
+++ b/wp-includes/html-api/class-wp-html-processor.php
@@ -779,6 +779,8 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor {
* @since 6.7.2 Refactored so subclasses may extend.
*
* @return bool Whether a token was parsed.
+ *
+ * @phpstan-impure
*/
public function next_token(): bool {
return $this->next_visitable_token();
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 041c27289b..6252d87a85 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '7.2-alpha-64334';
+$wp_version = '7.2-alpha-64335';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.