Skip to content

Commit 9e2d045

Browse files
committed
Docs: Fix phpdoc types for WP_Speculation_Rules members.
What was previously `mixed` is actually a speculation rule which can be more accurately be typed as `array<string, mixed>`. Additionally, the return value of `jsonSerialize` is fixed to indicate it returns an array of lists as opposed an array of associative arrays. Developed in #8946 Follow-up to [59837]. Props justlevine, johnbillion, westonruter. See #64238, #63268, #62503. git-svn-id: https://develop.svn.wordpress.org/trunk@61280 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 539c2fc commit 9e2d045

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/wp-includes/class-wp-speculation-rules.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ final class WP_Speculation_Rules implements JsonSerializable {
2121
* Every `$rules` value is a map of `$id => $rule` pairs.
2222
*
2323
* @since 6.8.0
24-
* @var array<string, array<string, mixed>>
24+
* @var array<string, array<string, array<string, mixed>>>
2525
*/
2626
private $rules_by_mode = array();
2727

@@ -230,7 +230,7 @@ public function has_rule( string $mode, string $id ): bool {
230230
*
231231
* @since 6.8.0
232232
*
233-
* @return array<string, array<string, mixed>> Speculation rules data.
233+
* @return array<string, array<int, array<string, mixed>>> Speculation rules data.
234234
*/
235235
#[ReturnTypeWillChange]
236236
public function jsonSerialize() {

0 commit comments

Comments
 (0)