Make WordPress Core


Ignore:
Timestamp:
11/25/2025 01:58:14 AM (7 months ago)
Author:
westonruter
Message:

Docs: Update various class @var tags to indicate nullability.

This updates various @var tags on class properties to correctly indicate that the props may be null or unset:

  • WP_Dependencies::$all_queued_deps is nullable by both ::enqueue() and ::dequeue. Also, the types of the keys and values are specified.
  • WP_Duotone::$global_styles_presets and ::$global_styles_block_names start off unset and are only initialized by static classes.
  • WP_Query::init() and WP_Rewrite::init() are public methods that unset()s many class props.
  • WP_Theme::cache_delete() sets many props to null.

Developed in https://github.com/WordPress/wordpress-develop/pull/8953

Props justlevine, westonruter.
See #64238, #64224.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-rewrite.php

    r60458 r61299  
    5353     *
    5454     * @since 1.5.0
     55     * @var ?string
     56     */
     57    public $author_structure;
     58
     59    /**
     60     * Permalink structure for date archives.
     61     *
     62     * @since 1.5.0
     63     * @var ?string
     64     */
     65    public $date_structure;
     66
     67    /**
     68     * Permalink structure for pages.
     69     *
     70     * @since 1.5.0
     71     * @var ?string
     72     */
     73    public $page_structure;
     74
     75    /**
     76     * Base of the search permalink structure (example.com/$search_base/query).
     77     *
     78     * @since 1.5.0
    5579     * @var string
    5680     */
    57     public $author_structure;
    58 
    59     /**
    60      * Permalink structure for date archives.
    61      *
    62      * @since 1.5.0
    63      * @var string
    64      */
    65     public $date_structure;
    66 
    67     /**
    68      * Permalink structure for pages.
    69      *
    70      * @since 1.5.0
    71      * @var string
    72      */
    73     public $page_structure;
    74 
    75     /**
    76      * Base of the search permalink structure (example.com/$search_base/query).
    77      *
    78      * @since 1.5.0
    79      * @var string
    80      */
    8181    public $search_base = 'search';
    8282
     
    8585     *
    8686     * @since 1.5.0
    87      * @var string
     87     * @var ?string
    8888     */
    8989    public $search_structure;
     
    125125     *
    126126     * @since 1.5.0
    127      * @var string
     127     * @var ?string
    128128     */
    129129    public $comment_feed_structure;
     
    133133     *
    134134     * @since 1.5.0
    135      * @var string
     135     * @var ?string
    136136     */
    137137    public $feed_structure;
Note: See TracChangeset for help on using the changeset viewer.