From 9b1e0766f764126bd9b46bdc53d23dc57a75bf78 Mon Sep 17 00:00:00 2001 From: czapla Date: Tue, 1 Oct 2024 17:21:20 +0000 Subject: [PATCH] Interactivity API: Fix code formatting and add better types in docstrings. Follow-up to [62136]. Props swissspidy. Fixes #62149. Built from https://develop.svn.wordpress.org/trunk@59153 git-svn-id: http://core.svn.wordpress.org/trunk@58548 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../interactivity-api/class-wp-interactivity-api.php | 6 ++++-- wp-includes/interactivity-api/interactivity-api.php | 2 +- wp-includes/version.php | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/wp-includes/interactivity-api/class-wp-interactivity-api.php b/wp-includes/interactivity-api/class-wp-interactivity-api.php index 297e7ec5ff..75eba82c16 100644 --- a/wp-includes/interactivity-api/class-wp-interactivity-api.php +++ b/wp-includes/interactivity-api/class-wp-interactivity-api.php @@ -101,9 +101,10 @@ final class WP_Interactivity_API { * This is only available during directive processing, otherwise it is `null`. * * @since 6.7.0 - * @var array|null + * @var array{attributes: array}|null */ private $current_element = null; + /** * Gets and/or sets the initial state of an Interactivity API store for a * given namespace. @@ -306,6 +307,7 @@ final class WP_Interactivity_API { ? $context[ $store_namespace ] : array(); } + /** * Returns an array representation of the current element being processed. * @@ -313,7 +315,7 @@ final class WP_Interactivity_API { * * @since 6.7.0 * - * @return array|null Current element. + * @return array{attributes: array}|null Current element. */ public function get_element(): ?array { if ( null === $this->current_element ) { diff --git a/wp-includes/interactivity-api/interactivity-api.php b/wp-includes/interactivity-api/interactivity-api.php index 71102ae04b..7fa8031805 100644 --- a/wp-includes/interactivity-api/interactivity-api.php +++ b/wp-includes/interactivity-api/interactivity-api.php @@ -133,7 +133,7 @@ function wp_interactivity_get_context( ?string $store_namespace = null ): array * * @since 6.7.0 * - * @return array|null Current element. + * @return array{attributes: array}|null Current element. */ function wp_interactivity_get_element(): ?array { return wp_interactivity()->get_element(); diff --git a/wp-includes/version.php b/wp-includes/version.php index f7770bbe3b..a92137f3e7 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.7-beta1-59152'; +$wp_version = '6.7-beta1-59153'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.