wp/wp-includes/class-wp-block-parser.php
changeset 18 be944660c56a
parent 9 177826044cd9
child 21 48c4eec2b7e6
--- a/wp/wp-includes/class-wp-block-parser.php	Tue Dec 15 15:52:01 2020 +0100
+++ b/wp/wp-includes/class-wp-block-parser.php	Wed Sep 21 18:19:35 2022 +0200
@@ -10,7 +10,7 @@
  *
  * Holds the block structure in memory
  *
- * @since 3.8.0
+ * @since 5.0.0
  */
 class WP_Block_Parser_Block {
 	/**
@@ -18,7 +18,7 @@
 	 *
 	 * @example "core/paragraph"
 	 *
-	 * @since 3.8.0
+	 * @since 5.0.0
 	 * @var string
 	 */
 	public $blockName;
@@ -29,7 +29,7 @@
 	 * @example null
 	 * @example array( 'columns' => 3 )
 	 *
-	 * @since 3.8.0
+	 * @since 5.0.0
 	 * @var array|null
 	 */
 	public $attrs;
@@ -37,7 +37,7 @@
 	/**
 	 * List of inner blocks (of this same class)
 	 *
-	 * @since 3.8.0
+	 * @since 5.0.0
 	 * @var WP_Block_Parser_Block[]
 	 */
 	public $innerBlocks;
@@ -48,7 +48,7 @@
 	 *
 	 * @example "...Just <!-- wp:test /--> testing..." -> "Just testing..."
 	 *
-	 * @since 3.8.0
+	 * @since 5.0.0
 	 * @var string
 	 */
 	public $innerHTML;
@@ -72,7 +72,7 @@
 	 *
 	 * Will populate object properties from the provided arguments.
 	 *
-	 * @since 3.8.0
+	 * @since 5.0.0
 	 *
 	 * @param string $name         Name of block.
 	 * @param array  $attrs        Optional set of attributes from block comment delimiters.
@@ -95,13 +95,13 @@
  * Holds partial blocks in memory while parsing
  *
  * @internal
- * @since 3.8.0
+ * @since 5.0.0
  */
 class WP_Block_Parser_Frame {
 	/**
 	 * Full or partial block
 	 *
-	 * @since 3.8.0
+	 * @since 5.0.0
 	 * @var WP_Block_Parser_Block
 	 */
 	public $block;
@@ -109,7 +109,7 @@
 	/**
 	 * Byte offset into document for start of parse token
 	 *
-	 * @since 3.8.0
+	 * @since 5.0.0
 	 * @var int
 	 */
 	public $token_start;
@@ -117,7 +117,7 @@
 	/**
 	 * Byte length of entire parse token string
 	 *
-	 * @since 3.8.0
+	 * @since 5.0.0
 	 * @var int
 	 */
 	public $token_length;
@@ -126,7 +126,7 @@
 	 * Byte offset into document for after parse token ends
 	 * (used during reconstruction of stack into parse production)
 	 *
-	 * @since 3.8.0
+	 * @since 5.0.0
 	 * @var int
 	 */
 	public $prev_offset;
@@ -134,7 +134,7 @@
 	/**
 	 * Byte offset into document where leading HTML before token starts
 	 *
-	 * @since 3.8.0
+	 * @since 5.0.0
 	 * @var int
 	 */
 	public $leading_html_start;
@@ -144,7 +144,7 @@
 	 *
 	 * Will populate object properties from the provided arguments.
 	 *
-	 * @since 3.8.0
+	 * @since 5.0.0
 	 *
 	 * @param WP_Block_Parser_Block $block              Full or partial block.
 	 * @param int                   $token_start        Byte offset into document for start of parse token.
@@ -166,7 +166,7 @@
  *
  * Parses a document and constructs a list of parsed block objects
  *
- * @since 3.8.0
+ * @since 5.0.0
  * @since 4.0.0 returns arrays not objects, all attributes are arrays
  */
 class WP_Block_Parser {
@@ -175,7 +175,7 @@
 	 *
 	 * @example "Pre-text\n<!-- wp:paragraph -->This is inside a block!<!-- /wp:paragraph -->"
 	 *
-	 * @since 3.8.0
+	 * @since 5.0.0
 	 * @var string
 	 */
 	public $document;
@@ -183,7 +183,7 @@
 	/**
 	 * Tracks parsing progress through document
 	 *
-	 * @since 3.8.0
+	 * @since 5.0.0
 	 * @var int
 	 */
 	public $offset;
@@ -191,7 +191,7 @@
 	/**
 	 * List of parsed blocks
 	 *
-	 * @since 3.8.0
+	 * @since 5.0.0
 	 * @var WP_Block_Parser_Block[]
 	 */
 	public $output;
@@ -199,7 +199,7 @@
 	/**
 	 * Stack of partially-parsed structures in memory during parse
 	 *
-	 * @since 3.8.0
+	 * @since 5.0.0
 	 * @var WP_Block_Parser_Frame[]
 	 */
 	public $stack;
@@ -219,7 +219,7 @@
 	 * parse. In contrast to the specification parser this does not
 	 * return an error on invalid inputs.
 	 *
-	 * @since 3.8.0
+	 * @since 5.0.0
 	 *
 	 * @param string $document Input document being parsed.
 	 * @return WP_Block_Parser_Block[]
@@ -249,7 +249,7 @@
 	 * or breaking out of a level of nesting.
 	 *
 	 * @internal
-	 * @since 3.8.0
+	 * @since 5.0.0
 	 * @return bool
 	 */
 	function proceed() {
@@ -300,7 +300,7 @@
 				 */
 				if ( 0 === $stack_depth ) {
 					if ( isset( $leading_html_start ) ) {
-						$this->output[] = (array) self::freeform(
+						$this->output[] = (array) $this->freeform(
 							substr(
 								$this->document,
 								$leading_html_start,
@@ -394,7 +394,7 @@
 	 * Returns the type of the find: kind of find, block information, attributes
 	 *
 	 * @internal
-	 * @since 3.8.0
+	 * @since 5.0.0
 	 * @since 4.6.1 fixed a bug in attribute parsing which caused catastrophic backtracking on invalid block comments
 	 * @return array
 	 */
@@ -482,7 +482,7 @@
 	 * to the output list as a freeform block.
 	 *
 	 * @internal
-	 * @since 3.8.0
+	 * @since 5.0.0
 	 * @param null $length how many bytes of document text to output.
 	 */
 	function add_freeform( $length = null ) {
@@ -492,7 +492,7 @@
 			return;
 		}
 
-		$this->output[] = (array) self::freeform( substr( $this->document, $this->offset, $length ) );
+		$this->output[] = (array) $this->freeform( substr( $this->document, $this->offset, $length ) );
 	}
 
 	/**
@@ -500,7 +500,7 @@
 	 * a new block to the output list.
 	 *
 	 * @internal
-	 * @since 3.8.0
+	 * @since 5.0.0
 	 * @param WP_Block_Parser_Block $block        The block to add to the output.
 	 * @param int                   $token_start  Byte offset into the document where the first token for the block starts.
 	 * @param int                   $token_length Byte length of entire block from start of opening token to end of closing token.
@@ -524,7 +524,7 @@
 	 * Pushes the top block from the parsing stack to the output list.
 	 *
 	 * @internal
-	 * @since 3.8.0
+	 * @since 5.0.0
 	 * @param int|null $end_offset byte offset into document for where we should stop sending text output as HTML.
 	 */
 	function add_block_from_stack( $end_offset = null ) {
@@ -541,7 +541,7 @@
 		}
 
 		if ( isset( $stack_top->leading_html_start ) ) {
-			$this->output[] = (array) self::freeform(
+			$this->output[] = (array) $this->freeform(
 				substr(
 					$this->document,
 					$stack_top->leading_html_start,