Skip to content

Commit e0dd355

Browse files
Docs: Remove variable names from @return tags.
Per the [https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/ inline documentation standards], `@return` tags should only contain the type and an optional description, not the name of the returned variable. This commit removes the variable names from all remaining `@return` tags in core. Developed in #13844. Props Soean, mukesh27. See #65860. git-svn-id: https://develop.svn.wordpress.org/trunk@64304 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 098fe1d commit e0dd355

10 files changed

Lines changed: 20 additions & 20 deletions

File tree

‎src/wp-admin/includes/class-custom-background.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -593,8 +593,8 @@ public function ajax_background_add() {
593593
* @since 3.4.0
594594
* @deprecated 3.5.0
595595
*
596-
* @param array $form_fields
597-
* @return array $form_fields
596+
* @param array $form_fields An array of attachment form fields.
597+
* @return array Unmodified form fields.
598598
*/
599599
public function attachment_fields_to_edit( $form_fields ) {
600600
return $form_fields;
@@ -604,8 +604,8 @@ public function attachment_fields_to_edit( $form_fields ) {
604604
* @since 3.4.0
605605
* @deprecated 3.5.0
606606
*
607-
* @param array $tabs
608-
* @return array $tabs
607+
* @param array $tabs An array of media upload tabs.
608+
* @return array Unmodified upload tabs.
609609
*/
610610
public function filter_upload_tabs( $tabs ) {
611611
return $tabs;

‎src/wp-admin/includes/class-custom-image-header.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,8 +1138,8 @@ public function admin_page() {
11381138
*
11391139
* @since 3.4.0
11401140
*
1141-
* @param array $form_fields
1142-
* @return array $form_fields
1141+
* @param array $form_fields An array of attachment form fields.
1142+
* @return array Unmodified form fields.
11431143
*/
11441144
public function attachment_fields_to_edit( $form_fields ) {
11451145
return $form_fields;
@@ -1150,8 +1150,8 @@ public function attachment_fields_to_edit( $form_fields ) {
11501150
*
11511151
* @since 3.4.0
11521152
*
1153-
* @param array $tabs
1154-
* @return array $tabs
1153+
* @param array $tabs An array of media upload tabs.
1154+
* @return array Unmodified upload tabs.
11551155
*/
11561156
public function filter_upload_tabs( $tabs ) {
11571157
return $tabs;

‎src/wp-admin/includes/media.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function media_upload_tabs() {
3939
* @global wpdb $wpdb WordPress database abstraction object.
4040
*
4141
* @param array $tabs Associative array of default tab names.
42-
* @return array $tabs Filtered tabs with gallery if post has image attachment.
42+
* @return array Filtered tabs with gallery if post has image attachment.
4343
*/
4444
function update_gallery_tab( $tabs ) {
4545
global $wpdb;

‎src/wp-includes/class-wp-editor.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1769,7 +1769,7 @@ public static function wp_fullscreen_html() {
17691769
* @type int $pagenum Page number. Default 1.
17701770
* @type string $s Search keywords.
17711771
* }
1772-
* @return array|false $results {
1772+
* @return array|false {
17731773
* An array of associative arrays of query results, false if there are none.
17741774
*
17751775
* @type array ...$0 {

‎src/wp-includes/class-wp-theme-json.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3430,7 +3430,7 @@ public function get_styles_block_nodes() {
34303430
* @since 6.1.1
34313431
*
34323432
* @param array $declarations List of declarations.
3433-
* @return array $declarations List of declarations filtered.
3433+
* @return array List of declarations filtered.
34343434
*/
34353435
private static function update_separator_declarations( $declarations ) {
34363436
$background_color = '';

‎src/wp-includes/comment.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3902,7 +3902,7 @@ function _close_comments_for_old_posts( $posts, $query ) {
39023902
*
39033903
* @param bool $open Comments open or closed.
39043904
* @param int $post_id Post ID.
3905-
* @return bool $open
3905+
* @return bool True if comments are open, false otherwise.
39063906
*/
39073907
function _close_comments_for_old_post( $open, $post_id ) {
39083908
if ( ! $open ) {

‎src/wp-includes/ms-blogs.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ function is_archived( $id ) {
741741
*
742742
* @param int $id Blog ID.
743743
* @param string $archived The new status.
744-
* @return string $archived
744+
* @return string The new archived status.
745745
*/
746746
function update_archived( $id, $archived ) {
747747
update_blog_status( $id, 'archived', $archived );
@@ -760,7 +760,7 @@ function update_archived( $id, $archived ) {
760760
* @param string $pref Field name.
761761
* @param string $value Field value.
762762
* @param mixed $deprecated Not used.
763-
* @return string|false $value
763+
* @return string|false The passed field value, or false if the update failed.
764764
*/
765765
function update_blog_status( $blog_id, $pref, $value, $deprecated = null ) {
766766
global $wpdb;
@@ -798,7 +798,7 @@ function update_blog_status( $blog_id, $pref, $value, $deprecated = null ) {
798798
*
799799
* @param int $id Blog ID.
800800
* @param string $pref Field name.
801-
* @return bool|string|null $value
801+
* @return bool|string|null The field value, or null if not found.
802802
*/
803803
function get_blog_status( $id, $pref ) {
804804
global $wpdb;

‎src/wp-includes/rest-api/endpoints/class-wp-rest-navigation-fallback-controller.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public function get_item_schema() {
147147
*
148148
* @param WP_Post $item The wp_navigation Post object whose response is being prepared.
149149
* @param WP_REST_Request $request Request object.
150-
* @return WP_REST_Response $response The response data.
150+
* @return WP_REST_Response The response data.
151151
*/
152152
public function prepare_item_for_response( $item, $request ) {
153153
$data = array();

‎tests/phpunit/tests/kses.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2559,7 +2559,7 @@ public function data_wp_kses_object_data_url_with_port_number_allowed() {
25592559
* Filter upload directory for tests using port number.
25602560
*
25612561
* @param array $param See wp_upload_dir()
2562-
* @return array $param with a modified `url`.
2562+
* @return array Upload directory data with a modified `url`.
25632563
*/
25642564
public function wp_kses_upload_dir_filter( $param ) {
25652565
// Take care to replace the entire domain, including cases where it already has a port number.

‎tests/phpunit/tests/query/searchColumns.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ public function test_search_columns_should_be_filterable() {
342342
* @param string[] $search_columns Array of column names to be searched.
343343
* @param string $search Text being searched.
344344
* @param WP_Query $wp_query The current WP_Query instance.
345-
* @return string[] $search_columns Array of column names to be searched.
345+
* @return string[] Array of column names to be searched.
346346
*/
347347
public function post_supported_search_column( $search_columns, $search, $wp_query ) {
348348
$search_columns = array( 'post_title' );
@@ -373,7 +373,7 @@ public function test_search_columns_should_not_be_filterable_with_non_supported_
373373
* @param string[] $search_columns Array of column names to be searched.
374374
* @param string $search Text being searched.
375375
* @param WP_Query $wp_query The current WP_Query instance.
376-
* @return string[] $search_columns Array of column names to be searched.
376+
* @return string[] Array of column names to be searched.
377377
*/
378378
public function post_non_supported_search_column( $search_columns, $search, $wp_query ) {
379379
$search_columns = array( 'post_name' );
@@ -404,7 +404,7 @@ public function test_search_columns_should_not_be_filterable_with_non_existing_s
404404
* @param string[] $search_columns Array of column names to be searched.
405405
* @param string $search Text being searched.
406406
* @param WP_Query $wp_query The current WP_Query instance.
407-
* @return string[] $search_columns Array of column names to be searched.
407+
* @return string[] Array of column names to be searched.
408408
*/
409409
public function post_non_existing_search_column( $search_columns, $search, $wp_query ) {
410410
$search_columns = array( 'post_non_existing_column' );

0 commit comments

Comments
 (0)