Make WordPress Core

Opened 4 months ago

Closed 5 weeks ago

#65118 closed enhancement (fixed)

Docs: Correct WP_Network_Query params comments

Reported by: baikare.sandeep007 Owned by: westonruter
Priority: normal Milestone: 7.1
Component: Networks and Sites Version: 4.6
Severity: normal Keywords: has-patch
Cc: Focuses: docs, administration, multisite

Description

This patch improves the inline documentation for the WP_Network_Query class:

  • Clarifies and corrects PHPDoc blocks for class properties, specifying types and expected values.
  • Updates the constructor’s parameter documentation to reference the accepted arguments and their types.
  • Improves descriptions for complex array properties and return values, especially for query variables and results.
  • Enhances code readability and assists developers and IDEs with more accurate type information.

These changes are documentation-only and do not affect runtime behavior.

Attachments (1)

network-query.patch (1.9 KB ) - added by baikare.sandeep007 4 months ago.
network query comment documentation improvements

Download all attachments as: .zip

Change History (10)

@baikare.sandeep007
4 months ago

network query comment documentation improvements

#1 @baikare.sandeep007
4 months ago

  • Version trunk4.6

#2 @westonruter
4 months ago

  • Milestone Awaiting Review7.1

@baikaresandeep007 Thanks for the ticket. Would you please submit the patch as a pull request instead? This will facilitate review.

This ticket was mentioned in PR #11663 on WordPress/wordpress-develop by @baikare.sandeep007.


4 months ago
#3

Trac ticket: https://core.trac.wordpress.org/ticket/65118

## Use of AI Tools

@baikare.sandeep007 commented on PR #11663:


4 months ago
#4

Thanks @westonruter, created PR as requested.

@baikare.sandeep007 commented on PR #11663:


4 months ago
#5

@westonruter accepted suggestions. Thanks

#6 @westonruter
4 months ago

  • Owner set to westonruter
  • Status newreviewing

Queueing up for 7.1

#7 @wildworks
5 weeks ago

Please feel free to commit a patch at any time.

@westonruter commented on PR #11663:


5 weeks ago
#8

This reduces the PHPStan level 10 error count from 61 to 56.

#9 @westonruter
5 weeks ago

  • Resolutionfixed
  • Status reviewingclosed

In 62721:

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 https://github.com/WordPress/wordpress-develop/pull/11663.
Follow-up to r37894.

Props baikaresandeep007-1, westonruter.
See #64896.
Fixes #65118.

Note: See TracTickets for help on using tickets.