Skip to content

Commit 2361dea

Browse files
committed
Fix select types
1 parent 775d163 commit 2361dea

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -638,13 +638,15 @@ public function get_unsupported_exception() {
638638
/**
639639
* Use a selector to advance.
640640
*
641+
* @todo _doing_it_wrong on null selector?
642+
*
641643
* @param string $selectors
642-
* @return Generator<void>|null
644+
* @return Generator<void>
643645
*/
644646
public function select_all( string $selectors ): ?Generator {
645647
$select = WP_CSS_Selector::from_selectors( $selectors );
646648
if ( null === $select ) {
647-
return null;
649+
return;
648650
}
649651

650652
while ( $this->next_tag() ) {
@@ -660,13 +662,10 @@ public function select_all( string $selectors ): ?Generator {
660662
* If iterating through matching elements, use `select_all` instead.
661663
*
662664
* @param string $selectors
663-
* @return bool|null
665+
* @return bool
664666
*/
665667
public function select( string $selectors ) {
666668
$selection = $this->select_all( $selectors );
667-
if ( null === $selection ) {
668-
return null;
669-
}
670669
foreach ( $selection as $_ ) {
671670
return true;
672671
}

0 commit comments

Comments
 (0)