[wp-trac] [WordPress Trac] #56581: Wrong doc in WP_Block_Parser class

WordPress Trac noreply at wordpress.org
Sat Sep 17 16:54:25 UTC 2022


#56581: Wrong doc in WP_Block_Parser class
--------------------------+-----------------------------
 Reporter:  Chouby        |       Owner:  SergeyBiryukov
     Type:  defect (bug)  |      Status:  reviewing
 Priority:  normal        |   Milestone:  6.1
Component:  Editor        |     Version:  5.0
 Severity:  trivial       |  Resolution:
 Keywords:  has-patch     |     Focuses:  docs
--------------------------+-----------------------------

Comment (by SergeyBiryukov):

 Replying to [ticket:56581 Chouby]:
 > `WP_Block_Parser::parse()` is documented as returning
 `WP_Block_Parser_Block[]` but it returns an array or arrays.
 >
 > `WP_Block_Parser::$output` is also documented as being
 `WP_Block_Parser_Block[]` but is also an array of arrays.
 >
 > This is visible in several places of the `parse()` method where
 `$this->output` is explicitely casted to an array.

 Indeed. I believe we can use the `WP_Block_Parser_Block[][]` notation for
 that (with extra square brackets), there is a precedent for that in core
 as of [53058].

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56581#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list