From e076ee2ee128d8ed78f74d7b084138b23144f46f Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 17 Sep 2022 17:13:11 +0000 Subject: [PATCH] Docs: Correct `@return` type for `WP_Block_Parser::parse()`. This affects: * `WP_Block_Parser::parse()` * `WP_Block_Parser::$output` Both the method and the property are documented as returning `WP_Block_Parser_Block[]` (an array of `WP_Block_Parser_Block` objects), but the result is in fact an array of arrays of various values, so `array[]` is the correct notation. Follow-up to [43751] for the 5.0 branch, [44116] for trunk. Props Chouby. Fixes #56581. Built from https://develop.svn.wordpress.org/trunk@54194 git-svn-id: http://core.svn.wordpress.org/trunk@53753 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-block-parser.php | 14 ++++++++------ wp-includes/version.php | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/wp-includes/class-wp-block-parser.php b/wp-includes/class-wp-block-parser.php index e987307a0c..cbecb0d2b9 100644 --- a/wp-includes/class-wp-block-parser.php +++ b/wp-includes/class-wp-block-parser.php @@ -62,7 +62,7 @@ class WP_Block_Parser_Block { * 'innerContent' => array( 'Before', null, 'Inner', null, 'After' ), * ) * - * @since 5.0.0 + * @since 4.2.0 * @var array */ public $innerContent; @@ -164,9 +164,10 @@ class WP_Block_Parser_Frame { /** * Class WP_Block_Parser * - * Parses a document and constructs a list of parsed blocks. + * Parses a document and constructs a list of parsed block objects * * @since 5.0.0 + * @since 4.0.0 returns arrays not objects, all attributes are arrays */ class WP_Block_Parser { /** @@ -191,7 +192,7 @@ class WP_Block_Parser { * List of parsed blocks * * @since 5.0.0 - * @var WP_Block_Parser_Block[] + * @var array[] */ public $output; @@ -206,7 +207,7 @@ class WP_Block_Parser { /** * Empty associative array, here due to PHP quirks * - * @since 5.0.0 + * @since 4.4.0 * @var array empty associative array */ public $empty_attrs; @@ -221,7 +222,7 @@ class WP_Block_Parser { * @since 5.0.0 * * @param string $document Input document being parsed. - * @return WP_Block_Parser_Block[] + * @return array[] */ function parse( $document ) { $this->document = $document; @@ -394,6 +395,7 @@ class WP_Block_Parser { * * @internal * @since 5.0.0 + * @since 4.6.1 fixed a bug in attribute parsing which caused catastrophic backtracking on invalid block comments * @return array */ function next_token() { @@ -466,7 +468,7 @@ class WP_Block_Parser { * Returns a new block object for freeform HTML * * @internal - * @since 5.0.0 + * @since 3.9.0 * * @param string $innerHTML HTML content of block. * @return WP_Block_Parser_Block freeform block object. diff --git a/wp-includes/version.php b/wp-includes/version.php index e69a8381f8..dbf3015c75 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.1-alpha-54193'; +$wp_version = '6.1-alpha-54194'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.