Make WordPress Core


Ignore:
Timestamp:
11/25/2025 01:58:14 AM (12 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-duotone.php

    r61247 r61299  
    5353         * @since 6.3.0
    5454         *
    55          * @var array
     55         * @var ?array
    5656         */
    5757        private static $global_styles_block_names;
    … …  
    7777         * @since 6.3.0
    7878         *
    79          * @var array
     79         * @var ?array
    8080         */
    8181        private static $global_styles_presets;
Note: See TracChangeset for help on using the changeset viewer.