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
This commit is contained in:
czapla 2024-10-01 17:21:20 +00:00
parent 3dfff23c24
commit 9b1e0766f7
3 changed files with 6 additions and 4 deletions

View File

@ -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<mixed>|null
* @var array{attributes: array<string, string|bool>}|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<string, string|bool>}|null Current element.
*/
public function get_element(): ?array {
if ( null === $this->current_element ) {

View File

@ -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<string, string|bool>}|null Current element.
*/
function wp_interactivity_get_element(): ?array {
return wp_interactivity()->get_element();

View File

@ -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.