Docs: Correct return and parameter types for WP_Block_List methods.

Follow-up to [48159], [56803].

Props marian1.
Fixes #63753.
Built from https://develop.svn.wordpress.org/trunk@60618


git-svn-id: http://core.svn.wordpress.org/trunk@59954 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov
2025-08-07 14:47:34 +00:00
parent f2b80c32ee
commit 0cf4698be4
2 changed files with 9 additions and 9 deletions

View File

@@ -67,7 +67,7 @@ class WP_Block_List implements Iterator, ArrayAccess, Countable {
* *
* @link https://www.php.net/manual/en/arrayaccess.offsetexists.php * @link https://www.php.net/manual/en/arrayaccess.offsetexists.php
* *
* @param string $offset Offset of block to check for. * @param int $offset Offset of block to check for.
* @return bool Whether block exists. * @return bool Whether block exists.
*/ */
#[ReturnTypeWillChange] #[ReturnTypeWillChange]
@@ -82,8 +82,8 @@ class WP_Block_List implements Iterator, ArrayAccess, Countable {
* *
* @link https://www.php.net/manual/en/arrayaccess.offsetget.php * @link https://www.php.net/manual/en/arrayaccess.offsetget.php
* *
* @param string $offset Offset of block value to retrieve. * @param int $offset Offset of block value to retrieve.
* @return mixed|null Block value if exists, or null. * @return WP_Block|null Block value if exists, or null.
*/ */
#[ReturnTypeWillChange] #[ReturnTypeWillChange]
public function offsetGet( $offset ) { public function offsetGet( $offset ) {
@@ -105,8 +105,8 @@ class WP_Block_List implements Iterator, ArrayAccess, Countable {
* *
* @link https://www.php.net/manual/en/arrayaccess.offsetset.php * @link https://www.php.net/manual/en/arrayaccess.offsetset.php
* *
* @param string $offset Offset of block value to set. * @param int $offset Offset of block value to set.
* @param mixed $value Block value. * @param array|WP_Block $value Block value.
*/ */
#[ReturnTypeWillChange] #[ReturnTypeWillChange]
public function offsetSet( $offset, $value ) { public function offsetSet( $offset, $value ) {
@@ -124,7 +124,7 @@ class WP_Block_List implements Iterator, ArrayAccess, Countable {
* *
* @link https://www.php.net/manual/en/arrayaccess.offsetunset.php * @link https://www.php.net/manual/en/arrayaccess.offsetunset.php
* *
* @param string $offset Offset of block value to unset. * @param int $offset Offset of block value to unset.
*/ */
#[ReturnTypeWillChange] #[ReturnTypeWillChange]
public function offsetUnset( $offset ) { public function offsetUnset( $offset ) {
@@ -150,7 +150,7 @@ class WP_Block_List implements Iterator, ArrayAccess, Countable {
* *
* @link https://www.php.net/manual/en/iterator.current.php * @link https://www.php.net/manual/en/iterator.current.php
* *
* @return mixed Current element. * @return WP_Block|null Current element.
*/ */
#[ReturnTypeWillChange] #[ReturnTypeWillChange]
public function current() { public function current() {
@@ -164,7 +164,7 @@ class WP_Block_List implements Iterator, ArrayAccess, Countable {
* *
* @link https://www.php.net/manual/en/iterator.key.php * @link https://www.php.net/manual/en/iterator.key.php
* *
* @return mixed Key of the current element. * @return int|null Key of the current element.
*/ */
#[ReturnTypeWillChange] #[ReturnTypeWillChange]
public function key() { public function key() {

View File

@@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.9-alpha-60617'; $wp_version = '6.9-alpha-60618';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.