Make WordPress Core


Ignore:
Timestamp:
07/17/2024 12:51:34 AM (9 months ago)
Author:
dmsnell
Message:

Fix phpdoc nullable types in some files.

It was found that in several places in the HTML API and its supporting files,
the wrong form of type annotation was used for optional parameters.

Instead of using ?type, this patch uses type|type-of-default-value instead,
noting where important if the parameter is optional, and if so, what its default
value is.

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

Props dmsnell, jonsurrell.
See #61399.

File:
1 edited

Legend:

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

    r58677 r58742  
    500500     * @since 6.5.0 Accepts $above_this_node to start traversal above a given node, if it exists.
    501501     *
    502      * @param ?WP_HTML_Token $above_this_node Start traversing above this node, if provided and if the node exists.
     502     * @param WP_HTML_Token|null $above_this_node Optional. Start traversing above this node,
     503     *                                            if provided and if the node exists.
    503504     */
    504505    public function walk_up( $above_this_node = null ) {
Note: See TracChangeset for help on using the changeset viewer.