Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
*/
class WP_Block_Parser_Block {
/**
* Name of block
* Name of block, or `null` when the block is top-level freeform HTML content.
*
* @example "core/paragraph"
*
* @since 5.0.0
* @var string
* @var string|null
*/
public $blockName; // phpcs:ignore WordPress.NamingConventions.ValidVariableName

Expand Down Expand Up @@ -74,11 +74,11 @@ class WP_Block_Parser_Block {
*
* @since 5.0.0
*
* @param string $name Name of block.
* @param array $attrs Optional set of attributes from block comment delimiters.
* @param array $inner_blocks List of inner blocks (of this same class).
* @param string $inner_html Resultant HTML from inside block comment delimiters after removing inner blocks.
* @param array $inner_content List of string fragments and null markers where inner blocks were found.
* @param string|null $name Name of block, or `null` for freeform HTML content.
* @param array $attrs Optional set of attributes from block comment delimiters.
* @param array $inner_blocks List of inner blocks (of this same class).
* @param string $inner_html Resultant HTML from inside block comment delimiters after removing inner blocks.
* @param array $inner_content List of string fragments and null markers where inner blocks were found.
*/
public function __construct( $name, $attrs, $inner_blocks, $inner_html, $inner_content ) {
$this->blockName = $name; // phpcs:ignore WordPress.NamingConventions.ValidVariableName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class WP_Block_Parser {
/**
* List of parsed blocks
*
* See WP_Block_Parser_Block for the structure of each block.
*
* @since 5.0.0
* @var array[]
*/
Expand All @@ -59,7 +61,22 @@ class WP_Block_Parser {
* @since 5.0.0
*
* @param string $document Input document being parsed.
* @return array[]
* @return array[] {
* Array of block structures.
*
* @type array ...$0 {
* An associative array of a single parsed block object. See WP_Block_Parser_Block.
*
* @type string|null $blockName Name of block, or `null` when the block is
* top-level freeform HTML content.
* @type array $attrs Attributes from block comment delimiters.
* @type array[] $innerBlocks List of inner blocks. An array of arrays that
* have the same structure as this one.
* @type string $innerHTML HTML from inside block comment delimiters.
* @type array $innerContent List of string fragments and null markers where
* inner blocks were found.
* }
* }
*/
public function parse( $document ) {
$this->document = $document;
Expand Down
Loading