Skip to content

Commit 2b49715

Browse files
committed
HTML API: Remove nullable from get_breadcrumbs return type
Follow-up [58713] Props jonsurrell, westonruter, gziolo. Fixes #62674. git-svn-id: https://develop.svn.wordpress.org/trunk@59503 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 1467750 commit 2b49715

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/wp-includes/html-api/class-wp-html-processor.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,21 +1143,17 @@ public function step( $node_to_process = self::PROCESS_NEXT_NODE ): bool {
11431143
* Breadcrumbs start at the outermost parent and descend toward the matched element.
11441144
* They always include the entire path from the root HTML node to the matched element.
11451145
*
1146-
* @todo It could be more efficient to expose a generator-based version of this function
1147-
* to avoid creating the array copy on tag iteration. If this is done, it would likely
1148-
* be more useful to walk up the stack when yielding instead of starting at the top.
1149-
*
1150-
* Example
1146+
* Example:
11511147
*
11521148
* $processor = WP_HTML_Processor::create_fragment( '<p><strong><em><img></em></strong></p>' );
11531149
* $processor->next_tag( 'IMG' );
11541150
* $processor->get_breadcrumbs() === array( 'HTML', 'BODY', 'P', 'STRONG', 'EM', 'IMG' );
11551151
*
11561152
* @since 6.4.0
11571153
*
1158-
* @return string[]|null Array of tag names representing path to matched node, if matched, otherwise NULL.
1154+
* @return string[] Array of tag names representing path to matched node.
11591155
*/
1160-
public function get_breadcrumbs(): ?array {
1156+
public function get_breadcrumbs(): array {
11611157
return $this->breadcrumbs;
11621158
}
11631159

0 commit comments

Comments
 (0)