Make WordPress Core

Changeset 62458


Ignore:
Timestamp:
06/04/2026 09:10:15 AM (2 months ago)
Author:
dmsnell
Message:

Docs: Update parameter types to allow null for interactivity api functions

When [58327] added annotations for a nullable-typed argument in the Interactivity API, the PHPDoc comment wasn’t also updated. This patch adds the corresponding documentation update.

Prepared ahead of WCEU 2026, merged as part of Contributor Day.

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

Follow-up to [58327].

Props audrasjb, mukesh27, soean.
Fixes #65404.

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

Legend:

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

    r62070 r62458  
    139139         * @since 6.6.0 The `$store_namespace` param is optional.
    140140         *
    141          * @param string $store_namespace Optional. The unique store namespace identifier.
    142          * @param array  $state           Optional. The array that will be merged with the existing state for the specified
     141         * @param string|null $store_namespace Optional. The unique store namespace identifier.
     142         * @param array|null  $state           Optional. The array that will be merged with the existing state for the specified
    143143         *                                store namespace.
    144144         * @return array The current state for the specified store namespace. This will be the updated state if a $state
     
    312312         * @since 6.6.0
    313313         *
    314          * @param string $store_namespace Optional. The unique store namespace identifier.
     314         * @param string|null $store_namespace Optional. The unique store namespace identifier.
    315315         */
    316316        public function get_context( ?string $store_namespace = null ): array {
  • trunk/src/wp-includes/interactivity-api/interactivity-api.php

    r59153 r62458  
    5454 * @since 6.6.0 The namespace can be omitted when called inside derived state getters.
    5555 *
    56  * @param string $store_namespace The unique store namespace identifier.
    57  * @param array  $state           Optional. The array that will be merged with the existing state for the specified
    58  *                                store namespace.
     56 * @param string|null $store_namespace The unique store namespace identifier.
     57 * @param array       $state           Optional. The array that will be merged with the existing state for the specified
     58 *                                     store namespace.
    5959 * @return array The state for the specified store namespace. This will be the updated state if a $state argument was
    6060 *               provided.
     
    120120 * @since 6.6.0
    121121 *
    122  * @param string $store_namespace Optional. The unique store namespace identifier.
     122 * @param string|null $store_namespace Optional. The unique store namespace identifier.
    123123 * @return array The context for the specified store namespace.
    124124 */
Note: See TracChangeset for help on using the changeset viewer.