diff --git a/src/wp-admin/includes/class-wp-upgrader.php b/src/wp-admin/includes/class-wp-upgrader.php index d45c72f8a4..cf33046f6e 100644 --- a/src/wp-admin/includes/class-wp-upgrader.php +++ b/src/wp-admin/includes/class-wp-upgrader.php @@ -348,7 +348,7 @@ class WP_Upgrader { * * @param array $nested_files Array of files as returned by WP_Filesystem::dirlist() * @param string $path Relative path to prepend to child nodes. Optional. - * @return array $files A flattened array of the $nested_files specified. + * @return array A flattened array of the $nested_files specified. */ protected function flatten_dirlist( $nested_files, $path = '' ) { $files = array(); diff --git a/src/wp-admin/includes/deprecated.php b/src/wp-admin/includes/deprecated.php index ec5c7f7c2a..5df3b87403 100644 --- a/src/wp-admin/includes/deprecated.php +++ b/src/wp-admin/includes/deprecated.php @@ -1001,7 +1001,7 @@ function add_contextual_help( $screen, $help ) { * @deprecated 3.4.0 Use wp_get_themes() * @see wp_get_themes() * - * @return array $themes Array of allowed themes. + * @return WP_Theme[] Array of WP_Theme objects keyed by their name. */ function get_allowed_themes() { _deprecated_function( __FUNCTION__, '3.4.0', "wp_get_themes( array( 'allowed' => true ) )" ); diff --git a/src/wp-admin/includes/image.php b/src/wp-admin/includes/image.php index a0f78ed3db..a22bf124e9 100644 --- a/src/wp-admin/includes/image.php +++ b/src/wp-admin/includes/image.php @@ -244,7 +244,12 @@ function wp_create_image_subsizes( $file, $attachment_id ) { * @since 5.3.0 * * @param int $threshold The threshold value in pixels. Default 2560. - * @param array $imagesize Indexed array of the image width and height (in that order). + * @param array $imagesize { + * Indexed array of the image width and height in pixels. + * + * @type int $0 The image width. + * @type int $0 The image height. + * } * @param string $file Full path to the uploaded image file. * @param int $attachment_id Attachment post ID. */ @@ -535,8 +540,8 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) { * * @since 4.7.0 * - * @param array $fallback_sizes An array of image size names. - * @param array $metadata Current attachment metadata. + * @param string[] $fallback_sizes An array of image size names. + * @param array $metadata Current attachment metadata. */ $fallback_sizes = apply_filters( 'fallback_intermediate_image_sizes', $fallback_sizes, $metadata ); diff --git a/src/wp-admin/includes/nav-menu.php b/src/wp-admin/includes/nav-menu.php index cb0bbe6449..d10ce01594 100644 --- a/src/wp-admin/includes/nav-menu.php +++ b/src/wp-admin/includes/nav-menu.php @@ -1126,7 +1126,7 @@ function _wp_delete_orphaned_draft_menu_items() { * * @param int|string $nav_menu_selected_id (id, slug, or name ) of the currently-selected menu * @param string $nav_menu_selected_title Title of the currently-selected menu - * @return array $messages The menu updated message + * @return array The menu updated message */ function wp_nav_menu_update_menu_items( $nav_menu_selected_id, $nav_menu_selected_title ) { $unsorted_menu_items = wp_get_nav_menu_items( diff --git a/src/wp-includes/class-wp-customize-widgets.php b/src/wp-includes/class-wp-customize-widgets.php index 1a0ae316e9..297342238a 100644 --- a/src/wp-includes/class-wp-customize-widgets.php +++ b/src/wp-includes/class-wp-customize-widgets.php @@ -1104,7 +1104,7 @@ final class WP_Customize_Widgets { * @since 4.2.0 * * @param array $nonces Array of nonces. - * @return array $nonces Array of nonces. + * @return array Array of nonces. */ public function refresh_nonces( $nonces ) { $nonces['update-widget'] = wp_create_nonce( 'update-widget' ); diff --git a/src/wp-includes/comment.php b/src/wp-includes/comment.php index 7837ce94a9..78413c3c3e 100644 --- a/src/wp-includes/comment.php +++ b/src/wp-includes/comment.php @@ -3393,7 +3393,7 @@ function wp_handle_comment_submission( $comment_data ) { * @since 4.9.6 * * @param array $exporters An array of personal data exporters. - * @return array $exporters An array of personal data exporters. + * @return array An array of personal data exporters. */ function wp_register_comment_personal_data_exporter( $exporters ) { $exporters['wordpress-comments'] = array( @@ -3411,7 +3411,7 @@ function wp_register_comment_personal_data_exporter( $exporters ) { * * @param string $email_address The comment author email address. * @param int $page Comment page. - * @return array $return An array of personal data. + * @return array An array of personal data. */ function wp_comments_personal_data_exporter( $email_address, $page = 1 ) { // Limit us to 500 comments at a time to avoid timing out. @@ -3503,7 +3503,7 @@ function wp_comments_personal_data_exporter( $email_address, $page = 1 ) { * @since 4.9.6 * * @param array $erasers An array of personal data erasers. - * @return array $erasers An array of personal data erasers. + * @return array An array of personal data erasers. */ function wp_register_comment_personal_data_eraser( $erasers ) { $erasers['wordpress-comments'] = array( diff --git a/src/wp-includes/embed.php b/src/wp-includes/embed.php index 4301a4ef46..1588c68099 100644 --- a/src/wp-includes/embed.php +++ b/src/wp-includes/embed.php @@ -76,8 +76,12 @@ function wp_embed_defaults( $url = '' ) { * * @since 2.9.0 * - * @param array $size An array of embed width and height values - * in pixels (in that order). + * @param array $size { + * Indexed array of the embed width and height in pixels. + * + * @type int $0 The embed width. + * @type int $0 The embed height. + * } * @param string $url The URL that should be embedded. */ return apply_filters( 'embed_defaults', compact( 'width', 'height' ), $url ); diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index 47ee58a3ad..995268fd41 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -6395,7 +6395,7 @@ function wp_auth_check_html() { * @global int $login_grace_period * * @param array $response The Heartbeat response. - * @return array $response The Heartbeat response with 'wp-auth-check' value set. + * @return array The Heartbeat response with 'wp-auth-check' value set. */ function wp_auth_check( $response ) { $response['wp-auth-check'] = is_user_logged_in() && empty( $GLOBALS['login_grace_period'] ); diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php index 90727be7a9..4ead3ab8cd 100644 --- a/src/wp-includes/media.php +++ b/src/wp-includes/media.php @@ -1107,8 +1107,7 @@ function _wp_get_attachment_relative_path( $file ) { * * @param string $size_name Image size. Accepts any valid image size name ('thumbnail', 'medium', etc.). * @param array $image_meta The image meta data. - * @return array|bool Array of width and height values in pixels (in that order) - * or false if the size doesn't exist. + * @return array|bool The image meta data as returned by `wp_get_attachment_metadata()`. */ function _wp_get_image_size_from_meta( $size_name, $image_meta ) { if ( $size_name === 'full' ) { diff --git a/src/wp-includes/ms-functions.php b/src/wp-includes/ms-functions.php index 99a5533dc2..a87f44175a 100644 --- a/src/wp-includes/ms-functions.php +++ b/src/wp-includes/ms-functions.php @@ -2577,7 +2577,7 @@ function wp_is_large_network( $using = 'sites', $network_id = null ) { * * @since 4.4.0 * - * @return array $names Array of reserved subdirectory names. + * @return array Array of reserved subdirectory names. */ function get_subdirectory_reserved_names() { $names = array( diff --git a/src/wp-includes/rest-api.php b/src/wp-includes/rest-api.php index 417b8ddada..ae4f609ac0 100644 --- a/src/wp-includes/rest-api.php +++ b/src/wp-includes/rest-api.php @@ -1165,7 +1165,7 @@ function rest_is_boolean( $maybe_bool ) { * * @param mixed $id_or_email The Gravatar to retrieve a URL for. Accepts a user_id, gravatar md5 hash, * user email, WP_User object, WP_Post object, or WP_Comment object. - * @return array $urls Gravatar url for each size. + * @return array Gravatar url for each size. */ function rest_get_avatar_urls( $id_or_email ) { $avatar_sizes = rest_get_avatar_sizes(); diff --git a/tests/phpunit/tests/ajax/PrivacyErasePersonalData.php b/tests/phpunit/tests/ajax/PrivacyErasePersonalData.php index 6bab7ca855..1d14fa10f9 100644 --- a/tests/phpunit/tests/ajax/PrivacyErasePersonalData.php +++ b/tests/phpunit/tests/ajax/PrivacyErasePersonalData.php @@ -177,7 +177,7 @@ class Tests_Ajax_PrivacyErasePersonalData extends WP_Ajax_UnitTestCase { * * @param array $erasers List of data erasers. * - * @return array $erasersList of data erasers. + * @return array Array of data erasers. */ public function filter_eraser_callback_value( $erasers ) { $erasers[ self::$eraser_key ]['callback'] = $this->new_callback_value; @@ -204,7 +204,7 @@ class Tests_Ajax_PrivacyErasePersonalData extends WP_Ajax_UnitTestCase { * * @param array $erasers Erasers. * - * @return array $erasers Erasers. + * @return array Erasers. */ public function filter_unset_eraser_index( $erasers ) { if ( false === $this->key_to_unset ) { @@ -236,7 +236,7 @@ class Tests_Ajax_PrivacyErasePersonalData extends WP_Ajax_UnitTestCase { * @param string $email_address The requester's email address. * @param int $page Page number. * - * @return array $return Export data. + * @return array Export data. */ public function filter_unset_response_index( $email_address, $page = 1 ) { $response = $this->callback_personal_data_eraser( $email_address, $page ); @@ -649,7 +649,7 @@ class Tests_Ajax_PrivacyErasePersonalData extends WP_Ajax_UnitTestCase { * @param string $email_address The requester's email address. * @param int $page Page number. * - * @return array $return Export data. + * @return array Export data. */ public function filter_response_messages_invalid( $email_address, $page = 1 ) { $response = $this->callback_personal_data_eraser( $email_address, $page ); @@ -770,7 +770,7 @@ class Tests_Ajax_PrivacyErasePersonalData extends WP_Ajax_UnitTestCase { * * @param array $erasers An array of personal data erasers. * - * @return array $erasers An array of personal data erasers. + * @return array An array of personal data erasers. */ public function register_custom_personal_data_eraser( $erasers ) { $erasers[ self::$eraser_key ] = array( diff --git a/tests/phpunit/tests/ajax/PrivacyExportPersonalData.php b/tests/phpunit/tests/ajax/PrivacyExportPersonalData.php index 0140654c0a..739b631009 100644 --- a/tests/phpunit/tests/ajax/PrivacyExportPersonalData.php +++ b/tests/phpunit/tests/ajax/PrivacyExportPersonalData.php @@ -188,7 +188,7 @@ class Tests_Ajax_PrivacyExportPersonalData extends WP_Ajax_UnitTestCase { * @since 5.2.0 * * @param array $exporters List of data exporters. - * @return array $exporters List of data exporters. + * @return array List of data exporters. */ public function filter_exporter_callback_value( $exporters ) { $exporters[ self::$exporter_key ]['callback'] = $this->new_callback_value; @@ -211,7 +211,7 @@ class Tests_Ajax_PrivacyExportPersonalData extends WP_Ajax_UnitTestCase { * * @param array $exporters List of data exporters. * - * @return array $exporters List of data exporters. + * @return array List of data exporters. */ public function filter_unset_exporter_key( $exporters ) { if ( false === $this->key_to_unset ) { @@ -589,7 +589,7 @@ class Tests_Ajax_PrivacyExportPersonalData extends WP_Ajax_UnitTestCase { * @param string $email_address The requester's email address. * @param int $page Page number. * - * @return array $return Export data. + * @return array Export data. */ public function callback_missing_data_response( $email_address, $page = 1 ) { $response = $this->callback_custom_personal_data_exporter( $email_address, $page ); @@ -625,7 +625,7 @@ class Tests_Ajax_PrivacyExportPersonalData extends WP_Ajax_UnitTestCase { * @param string $email_address The requester's email address. * @param int $page Page number. * - * @return array $return Export data. + * @return array Export data. */ public function callback_missing_data_array_response( $email_address, $page = 1 ) { $response = $this->callback_custom_personal_data_exporter( $email_address, $page ); @@ -660,7 +660,7 @@ class Tests_Ajax_PrivacyExportPersonalData extends WP_Ajax_UnitTestCase { * @param string $email_address The requester's email address. * @param int $page Page number. * - * @return array $return Export data. + * @return array Export data. */ public function callback_missing_done_response( $email_address, $page = 1 ) { $response = $this->callback_custom_personal_data_exporter( $email_address, $page ); @@ -739,7 +739,7 @@ class Tests_Ajax_PrivacyExportPersonalData extends WP_Ajax_UnitTestCase { * @param bool $send_as_email Whether the final results of the export should be emailed to the user. * @param string $exporter_key The key (slug) of the exporter that provided this data. * - * @return array $response The personal data for the given exporter and page. + * @return array The personal data for the given exporter and page. */ public function filter_exporter_data_response( $response, $exporter_index, $email_address, $page, $request_id, $send_as_email, $exporter_key ) { $group_label = sprintf( @@ -767,7 +767,7 @@ class Tests_Ajax_PrivacyExportPersonalData extends WP_Ajax_UnitTestCase { * * @param array $exporters An array of personal data exporters. * - * @return array $exporters An array of personal data exporters. + * @return array An array of personal data exporters. */ public function filter_register_custom_personal_data_exporter( $exporters ) { $exporters[ self::$exporter_key ] = array( @@ -785,7 +785,7 @@ class Tests_Ajax_PrivacyExportPersonalData extends WP_Ajax_UnitTestCase { * @param string $email_address The requester's email address. * @param int $page Page number. * - * @return array $response Export data response. + * @return array Export data response. */ public function callback_custom_personal_data_exporter( $email_address, $page = 1 ) { $data_to_export = array(); diff --git a/tests/phpunit/tests/comment/isAvatarCommentType.php b/tests/phpunit/tests/comment/isAvatarCommentType.php index 9e0111cc04..b01e019315 100644 --- a/tests/phpunit/tests/comment/isAvatarCommentType.php +++ b/tests/phpunit/tests/comment/isAvatarCommentType.php @@ -71,7 +71,7 @@ class Tests_Comment_IsAvatarCommentType extends WP_UnitTestCase { * @since 5.1.0 * * @param array $types An array of content types. - * @return array $types An array of content types. + * @return array An array of content types. */ public function _filter_avatar_comment_types( $types ) { $types[] = 'review'; diff --git a/tests/phpunit/tests/functions/doEnclose.php b/tests/phpunit/tests/functions/doEnclose.php index 7b2c62ed2c..8b38e9f574 100644 --- a/tests/phpunit/tests/functions/doEnclose.php +++ b/tests/phpunit/tests/functions/doEnclose.php @@ -233,7 +233,7 @@ class Tests_Functions_DoEnclose extends WP_UnitTestCase { * * @param array $post_links An array of enclosure links. * @param int $post_id Post ID. - * @return array $post_links An array of enclosure links. + * @return array An array of enclosure links. */ public function filter_enclosure_links( $enclosure_links, $post_id ) { // Replace the link host to contain the post ID, to test both filter input arguments. diff --git a/tests/phpunit/tests/privacy/wpPrivacyProcessPersonalDataExportPage.php b/tests/phpunit/tests/privacy/wpPrivacyProcessPersonalDataExportPage.php index baf0db89cc..c232526c69 100644 --- a/tests/phpunit/tests/privacy/wpPrivacyProcessPersonalDataExportPage.php +++ b/tests/phpunit/tests/privacy/wpPrivacyProcessPersonalDataExportPage.php @@ -210,7 +210,7 @@ class Tests_Privacy_WpPrivacyProcessPersonalDataExportPage extends WP_UnitTestCa * @since 5.2.0 * * @param array $exporters An array of personal data exporters. - * @return array $exporters An array of personal data exporters. + * @return array An array of personal data exporters. */ public function filter_register_custom_personal_data_exporters( $exporters ) { // Let's override other unrelated exporters.