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/class-wp-token-map.php

    r58281 r58742  
    521521     * @since 6.6.0
    522522     *
    523      * @param string  $text                       String in which to search for a lookup key.
    524      * @param int     $offset                     Optional. How many bytes into the string where the lookup key ought to start. Default 0.
    525      * @param ?int    &$matched_token_byte_length Optional. Holds byte-length of found token matched, otherwise not set. Default null.
    526      * @param string  $case_sensitivity           Optional. Pass 'ascii-case-insensitive' to ignore ASCII case when matching. Default 'case-sensitive'.
     523     * @param string   $text                       String in which to search for a lookup key.
     524     * @param int      $offset                     Optional. How many bytes into the string where the lookup key ought to start. Default 0.
     525     * @param int|null &$matched_token_byte_length Optional. Holds byte-length of found token matched, otherwise not set. Default null.
     526     * @param string   $case_sensitivity           Optional. Pass 'ascii-case-insensitive' to ignore ASCII case when matching. Default 'case-sensitive'.
     527     *
    527528     * @return string|null Mapped value of lookup key if found, otherwise `null`.
    528529     */
Note: See TracChangeset for help on using the changeset viewer.