Make WordPress Core

Changeset 58364


Ignore:
Timestamp:
06/08/2024 11:10:58 AM (12 months ago)
Author:
dmsnell
Message:

HTML API: Fix three small type-related bugs.

This applies three fixes that appeared as part of
adding type annotations to the HTML API.

Developed in https://github.com/WordPress/wordpress-develop/pull/6754
Discussed in https://core.trac.wordpress.org/ticket/61399

Props jonsurrell.
See #61399.
Follow-up to [55203], [56274].

Location:
trunk/src/wp-includes/html-api
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/html-api/class-wp-html-processor.php

    r58363 r58364  
    544544        if (
    545545            WP_HTML_Stack_Event::POP === $this->current_element->operation &&
    546             ! static::expects_closer( $this->current_element->token->node_name )
     546            ! static::expects_closer( $this->current_element->token )
    547547        ) {
    548548            return $this->next_token();
  • trunk/src/wp-includes/html-api/class-wp-html-tag-processor.php

    r58281 r58364  
    22662266     * @return int How many bytes the given pointer moved in response to the updates.
    22672267     */
    2268     private function apply_attributes_updates( $shift_this_point = 0 ) {
     2268    private function apply_attributes_updates( $shift_this_point ) {
    22692269        if ( ! count( $this->lexical_updates ) ) {
    22702270            return 0;
     
    27882788                return '#funky-comment';
    27892789        }
     2790
     2791        return null;
    27902792    }
    27912793
     
    31963198         * be necessary for reparsing the current tag after updating the HTML.
    31973199         */
    3198         $before_current_tag = $this->token_starts_at;
     3200        $before_current_tag = $this->token_starts_at ?? 0;
    31993201
    32003202        /*
Note: See TracChangeset for help on using the changeset viewer.