Skip to content

Commit bcab1ec

Browse files
committed
Docs: Add specific types to WP_Network_Query properties.
Replace the generic `array` type in the docblocks for the `$sql_clauses`, `$query_vars`, `$query_var_defaults`, and `$networks` properties with specific types, including an array shape for `$sql_clauses` and `WP_Network[]|int[]` for `$networks`. Additionally, document the `$found_networks` and `$max_num_pages` counts as `non-negative-int`. Developed in WordPress#11663. Follow-up to r37894. Props baikaresandeep007-1, westonruter. See #64896. Fixes #65118. git-svn-id: https://develop.svn.wordpress.org/trunk@62721 602fd350-edb4-49c9-b593-d223f7449a82
1 parent dfff16f commit bcab1ec

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

src/wp-includes/class-wp-network-query.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,14 @@ class WP_Network_Query {
2929
* SQL query clauses.
3030
*
3131
* @since 4.6.0
32-
* @var array
32+
* @var array{
33+
* select: string,
34+
* from: string,
35+
* where: array<string, string>,
36+
* groupby: string,
37+
* orderby: string,
38+
* limits: string
39+
* }
3340
*/
3441
protected $sql_clauses = array(
3542
'select' => '',
@@ -44,23 +51,23 @@ class WP_Network_Query {
4451
* Query vars set by the user.
4552
*
4653
* @since 4.6.0
47-
* @var array
54+
* @var array<string, mixed>
4855
*/
4956
public $query_vars;
5057

5158
/**
5259
* Default values for query vars.
5360
*
5461
* @since 4.6.0
55-
* @var array
62+
* @var array<string, mixed>
5663
*/
5764
public $query_var_defaults;
5865

5966
/**
6067
* List of networks located by the query.
6168
*
6269
* @since 4.6.0
63-
* @var array
70+
* @var WP_Network[]|int[]
6471
*/
6572
public $networks;
6673

@@ -69,6 +76,7 @@ class WP_Network_Query {
6976
*
7077
* @since 4.6.0
7178
* @var int
79+
* @phpstan-var non-negative-int
7280
*/
7381
public $found_networks = 0;
7482

@@ -77,6 +85,7 @@ class WP_Network_Query {
7785
*
7886
* @since 4.6.0
7987
* @var int
88+
* @phpstan-var non-negative-int
8089
*/
8190
public $max_num_pages = 0;
8291

0 commit comments

Comments
 (0)