Docs: Remove unnecessary variables names from @return tags.

See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48100 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn 2020-06-19 22:53:54 +00:00
parent b34efdd38a
commit 1db25e3d38
35 changed files with 61 additions and 61 deletions

View File

@ -1419,7 +1419,7 @@ function _wp_privacy_settings_filter_draft_page_titles( $title, $page ) {
* @since 5.1.0
* @since 5.1.1 Added the {@see 'wp_is_php_version_acceptable'} filter.
*
* @return array|false $response Array of PHP version data. False on failure.
* @return array|false Array of PHP version data. False on failure.
*/
function wp_check_php_version() {
$version = phpversion();

View File

@ -1023,7 +1023,7 @@ function _wp_nav_menu_meta_box_object( $object = null ) {
* @since 3.0.0
*
* @param int $menu_id Optional. The ID of the menu to format. Default 0.
* @return string|WP_Error $output The menu formatted to edit or error object on failure.
* @return string|WP_Error The menu formatted to edit or error object on failure.
*/
function wp_get_nav_menu_to_edit( $menu_id = 0 ) {
$menu = wp_get_nav_menu_object( $menu_id );

View File

@ -40,8 +40,8 @@ function _wp_privacy_resend_request( $request_id ) {
* @since 4.9.6
* @access private
*
* @param int $request_id Request ID.
* @return int|WP_Error $result Request ID on success or WP_Error.
* @param int $request_id Request ID.
* @return int|WP_Error Request ID on success, or a WP_Error on failure.
*/
function _wp_privacy_completed_request( $request_id ) {
// Get the request.
@ -233,9 +233,9 @@ function _wp_personal_data_cleanup_requests() {
* }
* }
* }
* @param string $group_id The group identifier.
* @param int $groups_count The number of all groups
* @return string $group_html The HTML for this group and its items.
* @param string $group_id The group identifier.
* @param int $groups_count The number of all groups
* @return string The HTML for this group and its items.
*/
function wp_privacy_generate_personal_data_export_group_html( $group_data, $group_id = '', $groups_count = 1 ) {
$group_id_attr = sanitize_title_with_dashes( $group_data['group_label'] . '-' . $group_id );

View File

@ -287,8 +287,8 @@ function sanitize_category_field( $field, $value, $cat_id, $context ) {
*
* @type string $taxonomy Taxonomy to retrieve terms for. Default 'post_tag'.
* }
* @return WP_Term[]|int|WP_Error $tags Array of 'post_tag' term objects, a count thereof,
* or WP_Error if any of the taxonomies do not exist.
* @return WP_Term[]|int|WP_Error Array of 'post_tag' term objects, a count thereof,
* or WP_Error if any of the taxonomies do not exist.
*/
function get_tags( $args = '' ) {
$defaults = array( 'taxonomy' => 'post_tag' );

View File

@ -1814,7 +1814,7 @@ final class WP_Customize_Manager {
* @param WP_Customize_Setting $setting A WP_Customize_Setting derived object.
* @param mixed $default Value returned $setting has no post value (added in 4.2.0)
* or the post value is invalid (added in 4.6.0).
* @return string|mixed $post_value Sanitized value or the $default provided.
* @return string|mixed Sanitized value or the $default provided.
*/
public function post_value( $setting, $default = null ) {
$post_values = $this->unsanitized_post_values();

View File

@ -76,7 +76,7 @@ final class WP_Customize_Nav_Menus {
* @since 4.5.0
*
* @param string[] $nonces Array of nonces.
* @return string[] $nonces Modified array of nonces.
* @return string[] Modified array of nonces.
*/
public function filter_nonces( $nonces ) {
$nonces['customize-menus'] = wp_create_nonce( 'customize-menus' );

View File

@ -205,7 +205,7 @@ abstract class WP_Image_Editor {
*
* @since 4.0.0
*
* @return int $quality Compression Quality. Range: [1,100]
* @return int Compression Quality. Range: [1,100]
*/
public function get_quality() {
if ( ! $this->quality ) {

View File

@ -4294,7 +4294,7 @@ class WP_Query {
* @since 5.2.0
*
* @param WP_Post|object|int $post WP_Post instance or Post ID/object.
* @return array|bool $elements Elements of post or false on failure.
* @return array|bool Elements of post or false on failure.
*/
public function generate_postdata( $post ) {

View File

@ -26,7 +26,7 @@ final class WP_Recovery_Mode_Key_Service {
*
* @since 5.2.0
*
* @return string $token A random string to identify its associated key in storage.
* @return string A random string to identify its associated key in storage.
*/
public function generate_recovery_mode_token() {
return wp_generate_password( 22, false );
@ -40,7 +40,7 @@ final class WP_Recovery_Mode_Key_Service {
* @global PasswordHash $wp_hasher
*
* @param string $token A token generated by {@see generate_recovery_mode_token()}.
* @return string $key Recovery mode key.
* @return string Recovery mode key.
*/
public function generate_and_store_recovery_mode_key( $token ) {

View File

@ -156,8 +156,8 @@ function check_comment( $author, $email, $url, $comment, $user_ip, $user_agent,
*
* @param int $post_id The ID of the post.
* @param array $args Optional. See WP_Comment_Query::__construct() for information on accepted arguments.
* @return int|array $comments The approved comments, or number of comments if `$count`
* argument is true.
* @return int|array The approved comments, or number of comments if `$count`
* argument is true.
*/
function get_approved_comments( $post_id, $args = array() ) {
if ( ! $post_id ) {

View File

@ -2761,7 +2761,7 @@ function stripslashes_deep( $value ) {
* @since 4.4.0
*
* @param mixed $value The array or string to be stripped.
* @return mixed $value The stripped value.
* @return mixed The stripped value.
*/
function stripslashes_from_strings_only( $value ) {
return is_string( $value ) ? stripslashes( $value ) : $value;
@ -2773,7 +2773,7 @@ function stripslashes_from_strings_only( $value ) {
* @since 2.2.0
*
* @param mixed $value The array or string to be encoded.
* @return mixed $value The encoded value.
* @return mixed The encoded value.
*/
function urlencode_deep( $value ) {
return map_deep( $value, 'urlencode' );
@ -2785,7 +2785,7 @@ function urlencode_deep( $value ) {
* @since 3.4.0
*
* @param mixed $value The array or string to be encoded.
* @return mixed $value The encoded value.
* @return mixed The encoded value.
*/
function rawurlencode_deep( $value ) {
return map_deep( $value, 'rawurlencode' );
@ -2797,7 +2797,7 @@ function rawurlencode_deep( $value ) {
* @since 4.4.0
*
* @param mixed $value The array or string to be decoded.
* @return mixed $value The decoded value.
* @return mixed The decoded value.
*/
function urldecode_deep( $value ) {
return map_deep( $value, 'urldecode' );

View File

@ -6981,7 +6981,7 @@ function wp_unique_id( $prefix = '' ) {
*
* @param string $group Where the cache contents are grouped.
*
* @return string $last_changed UNIX timestamp with microseconds representing when the group was last changed.
* @return string UNIX timestamp with microseconds representing when the group was last changed.
*/
function wp_cache_get_last_changed( $group ) {
$last_changed = wp_cache_get( 'last_changed', $group );
@ -7395,7 +7395,7 @@ function wp_update_php_annotation( $before = '<p class="description">', $after =
*
* @since 5.2.0
*
* @return string $message Update PHP page annotation. An empty string if no custom URLs are provided.
* @return string Update PHP page annotation. An empty string if no custom URLs are provided.
*/
function wp_get_update_php_annotation() {
$update_url = wp_get_update_php_url();

View File

@ -4753,7 +4753,7 @@ function __checked_selected_helper( $helper, $current, $echo, $type ) { // phpcs
* @since 3.6.0
*
* @param array $settings
* @return array $settings
* @return array Heartbeat settings.
*/
function wp_heartbeat_settings( $settings ) {
if ( ! is_admin() ) {

View File

@ -3629,7 +3629,7 @@ function self_admin_url( $path = '', $scheme = 'admin' ) {
* @param string $url Absolute URL that includes a scheme
* @param string|null $scheme Optional. Scheme to give $url. Currently 'http', 'https', 'login',
* 'login_post', 'admin', 'relative', 'rest', 'rpc', or null. Default null.
* @return string $url URL with chosen scheme.
* @return string URL with chosen scheme.
*/
function set_url_scheme( $url, $scheme = null ) {
$orig_scheme = $scheme;

View File

@ -721,7 +721,7 @@ function wp_get_mu_plugins() {
* @since 3.0.0
* @access private
*
* @return string[] $plugin_file Array of paths to plugin files relative to the plugins directory.
* @return string[] Array of paths to plugin files relative to the plugins directory.
*/
function wp_get_active_and_valid_plugins() {
$plugins = array();

View File

@ -747,7 +747,7 @@ function wp_image_matches_ratio( $source_width, $source_height, $target_width, $
* @param array|string $size Optional. Image size. Accepts any valid image size, or an array
* of width and height values in pixels (in that order).
* Default 'thumbnail'.
* @return array|false $data {
* @return array|false {
* Array of file relative path, width, and height on success. Additionally includes absolute
* path and URL if registered size is passed to $size parameter. False on failure.
*
@ -4549,7 +4549,7 @@ function wp_register_media_personal_data_exporter( $exporters ) {
*
* @param string $email_address The attachment owner email address.
* @param int $page Attachment page.
* @return array $return An array of personal data.
* @return array An array of personal data.
*/
function wp_media_personal_data_exporter( $email_address, $page = 1 ) {
// Limit us to 50 attachments at a time to avoid timing out.

View File

@ -983,7 +983,7 @@ function update_meta_cache( $meta_type, $object_ids ) {
*
* @since 4.5.0
*
* @return WP_Metadata_Lazyloader $lazyloader Metadata lazyloader queue.
* @return WP_Metadata_Lazyloader Metadata lazyloader queue.
*/
function wp_metadata_lazyloader() {
static $wp_metadata_lazyloader;

View File

@ -668,7 +668,7 @@ function _is_valid_nav_menu_item( $item ) {
* processed in this function. Default 'menu_order'.
* @type bool $nopaging Whether to retrieve all menu items (true) or paginate (false). Default true.
* }
* @return array|false $items Array of menu items, otherwise false.
* @return array|false Array of menu items, otherwise false.
*/
function wp_get_nav_menu_items( $menu, $args = array() ) {
$menu = wp_get_nav_menu_object( $menu );
@ -803,7 +803,7 @@ function wp_get_nav_menu_items( $menu, $args = array() ) {
* @since 3.0.0
*
* @param object $menu_item The menu item to modify.
* @return object $menu_item The menu item with standard menu item properties.
* @return object The menu item with standard menu item properties.
*/
function wp_setup_nav_menu_item( $menu_item ) {
if ( isset( $menu_item->post_type ) ) {

View File

@ -1380,7 +1380,7 @@ if ( ! function_exists( 'wp_safe_redirect' ) ) :
* @param string $location The path or URL to redirect to.
* @param int $status Optional. HTTP response status code to use. Default '302' (Moved Temporarily).
* @param string $x_redirect_by Optional. The application doing the redirect. Default 'WordPress'.
* @return bool $redirect False if the redirect was cancelled, true otherwise.
* @return bool False if the redirect was cancelled, true otherwise.
*/
function wp_safe_redirect( $location, $status = 302, $x_redirect_by = 'WordPress' ) {

View File

@ -1090,7 +1090,7 @@ function wp_old_slug_redirect() {
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param string $post_type The current post type based on the query vars.
* @return int $id The Post ID.
* @return int The Post ID.
*/
function _find_post_by_old_slug( $post_type ) {
global $wpdb;
@ -1125,7 +1125,7 @@ function _find_post_by_old_slug( $post_type ) {
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param string $post_type The current post type based on the query vars.
* @return int $id The Post ID.
* @return int The Post ID.
*/
function _find_post_by_old_date( $post_type ) {
global $wpdb;

View File

@ -719,7 +719,7 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
* @since 4.7.0
*
* @param WP_REST_Request $request Request object.
* @return object $prepared_term Term object.
* @return object Term object.
*/
public function prepare_item_for_database( $request ) {
$prepared_term = new stdClass;
@ -776,7 +776,7 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
*
* @param WP_Term $item Term object.
* @param WP_REST_Request $request Request object.
* @return WP_REST_Response $response Response object.
* @return WP_REST_Response Response object.
*/
public function prepare_item_for_response( $item, $request ) {

View File

@ -1095,7 +1095,7 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
* @since 4.7.0
*
* @param WP_REST_Request $request Request object.
* @return object $prepared_user User object.
* @return object User object.
*/
protected function prepare_item_for_database( $request ) {
$prepared_user = new stdClass;

View File

@ -42,7 +42,7 @@ abstract class WP_Sitemaps_Provider {
*
* @param int $page_num Page of results.
* @param string $object_subtype Optional. Object subtype name. Default empty.
* @return array $url_list Array of URLs for a sitemap.
* @return array Array of URLs for a sitemap.
*/
abstract public function get_url_list( $page_num, $object_subtype = '' );

View File

@ -127,7 +127,7 @@ class WP_Sitemaps_Users extends WP_Sitemaps_Provider {
*
* @since 5.5.0
*
* @return array $args Array of WP_User_Query arguments.
* @return array Array of WP_User_Query arguments.
*/
protected function get_users_query_args() {
$public_post_types = get_post_types(

View File

@ -3530,7 +3530,7 @@ All at ###SITENAME###
* @access private
*
* @param int $request_id The request ID being confirmed.
* @return string $message The confirmation message.
* @return string The confirmation message.
*/
function _wp_privacy_account_request_confirmed_message( $request_id ) {
$request = wp_get_user_request( $request_id );

View File

@ -3296,7 +3296,7 @@ class wpdb {
* @since 4.2.0
*
* @param string $query The query to search.
* @return string|false $table The table name found, or false if a table couldn't be found.
* @return string|false The table name found, or false if a table couldn't be found.
*/
protected function get_table_from_query( $query ) {
// Remove characters that can legally trail the table name.

View File

@ -21,7 +21,7 @@ class Tests_Admin_WpPrivacyRequestsTable extends WP_UnitTestCase {
*
* @since 5.1.0
*
* @return PHPUnit_Framework_MockObject_MockObject|WP_Privacy_Requests_Table $instance Mocked class instance.
* @return PHPUnit_Framework_MockObject_MockObject|WP_Privacy_Requests_Table Mocked class instance.
*/
public function get_mocked_class_instance() {
$args = array(
@ -91,7 +91,7 @@ class Tests_Admin_WpPrivacyRequestsTable extends WP_UnitTestCase {
* @since 5.1.0
*
* @param string $request The complete SQL query.
* @return string $request The complete SQL query.
* @return string The complete SQL query.
*/
public function filter_posts_request( $request ) {
$this->sql = $request;

View File

@ -784,7 +784,7 @@ class Tests_Ajax_PrivacyErasePersonalData extends WP_Ajax_UnitTestCase {
* @param string $email_address The comment author email address.
* @param int $page Page number.
*
* @return array $return Erase data.
* @return array Erase data.
*/
public function callback_personal_data_eraser( $email_address, $page = 1 ) {
if ( 1 === $page ) {

View File

@ -204,7 +204,7 @@ class Test_WP_Customize_Selective_Refresh extends WP_UnitTestCase {
*
* @param false|array $partial_args The arguments to the WP_Customize_Partial constructor.
* @param string $partial_id ID for dynamic partial.
* @return false|array $args Dynamic partial args.
* @return false|array Dynamic partial args.
*/
function filter_customize_dynamic_partial_args( $partial_args, $partial_id ) {
$this->assertTrue( false === $partial_args || is_array( $partial_args ) );

View File

@ -266,7 +266,7 @@ class Tests_Functions_Anonymization extends WP_UnitTestCase {
* @param string $anonymous Anonymized data.
* @param string $type Type of the data.
* @param string $data Original data.
* @return string $anonymous Anonymized data.
* @return string Anonymized data.
*/
public function filter_wp_privacy_anonymize_data( $anonymous, $type, $data ) {
if ( 'url' === $type && 'example.com' === parse_url( $data, PHP_URL_HOST ) ) {

View File

@ -198,7 +198,7 @@ class Tests_Privacy_WpPrivacySendErasureFulfillmentNotification extends WP_UnitT
* @since 5.1.0
*
* @param string $user_email The email address of the notification recipient.
* @return string $user_email The email address of the notification recipient.
* @return string The email address of the notification recipient.
*/
public function filter_email_address( $user_email ) {
return 'modified-' . $user_email;
@ -224,7 +224,7 @@ class Tests_Privacy_WpPrivacySendErasureFulfillmentNotification extends WP_UnitT
* @since 5.1.0
*
* @param string $subject The email subject.
* @return string $subject The email subject.
* @return string The email subject.
*/
public function filter_email_subject( $subject ) {
return 'Modified subject';
@ -250,7 +250,7 @@ class Tests_Privacy_WpPrivacySendErasureFulfillmentNotification extends WP_UnitT
* @since 5.1.0
*
* @param string $email_text Text in the email.
* @return string $email_text Text in the email.
* @return string Text in the email.
*/
public function filter_email_body_text( $email_text ) {
return 'Modified text';
@ -278,7 +278,7 @@ class Tests_Privacy_WpPrivacySendErasureFulfillmentNotification extends WP_UnitT
* @since 5.4.0
*
* @param string|array $headers The email headers.
* @return array $headers The new email headers.
* @return array The new email headers.
*/
public function modify_email_headers( $headers ) {
$headers = array(

View File

@ -167,7 +167,7 @@ class Tests_Privacy_WpPrivacySendPersonalDataExportEmail extends WP_UnitTestCase
* @since 4.9.6
*
* @param int $expiration The expiration age of the export, in seconds.
* @return int $expiration The expiration age of the export, in seconds.
* @return int The expiration age of the export, in seconds.
*/
public function modify_export_expiration( $expiration ) {
// Set date to always be "Mon, 18 Dec 2017 21:30:00 GMT", so can assert a fixed date.
@ -194,7 +194,7 @@ class Tests_Privacy_WpPrivacySendPersonalDataExportEmail extends WP_UnitTestCase
* @since 5.3.0
*
* @param string $user_email The email address of the notification recipient.
* @return string $user_email The modified email address of the notification recipient.
* @return string The modified email address of the notification recipient.
*/
public function filter_email_address( $user_email ) {
return 'modified-' . $user_email;
@ -220,7 +220,7 @@ class Tests_Privacy_WpPrivacySendPersonalDataExportEmail extends WP_UnitTestCase
* @since 5.3.0
*
* @param string $subject The email subject.
* @return string $subject The email subject.
* @return string The email subject.
*/
public function filter_email_subject( $subject ) {
return 'Modified subject';
@ -246,7 +246,7 @@ class Tests_Privacy_WpPrivacySendPersonalDataExportEmail extends WP_UnitTestCase
*
* @param string $email_text Text in the email.
* @param int $request_id The request ID for this personal data export.
* @return string $email_text Text in the email.
* @return string Text in the email.
*/
public function modify_email_content( $email_text, $request_id ) {
return 'Custom content for request ID: ' . $request_id;
@ -274,7 +274,7 @@ class Tests_Privacy_WpPrivacySendPersonalDataExportEmail extends WP_UnitTestCase
* @since 5.4.0
*
* @param string|array $headers The email headers.
* @return array $headers The new email headers.
* @return array The new email headers.
*/
public function modify_email_headers( $headers ) {
$headers = array(
@ -319,7 +319,7 @@ class Tests_Privacy_WpPrivacySendPersonalDataExportEmail extends WP_UnitTestCase
* @type string $siteurl The site URL sending the mail.
* }
*
* @return string $email_text Text in the email.
* @return string Text in the email.
*/
public function modify_email_content_with_email_data( $email_text, $request_id, $email_data ) {
return 'Custom content using the $site_url of $email_data: ' . $email_data['siteurl'];

View File

@ -235,7 +235,7 @@ class Tests_User_WpPrivacySendRequestConfirmationNotification extends WP_UnitTes
* @since 5.4.0
*
* @param string|array $headers The email headers.
* @return array $headers The new email headers.
* @return array The new email headers.
*/
public function modify_email_headers( $headers ) {
$headers = array(

View File

@ -1907,7 +1907,7 @@ class Tests_User extends WP_UnitTestCase {
*
* @ticket 47509
*
* @return array $additional_profile_data The additional user data.
* @return array The additional user data.
*/
public function export_additional_user_profile_data() {
$additional_profile_data = array(
@ -1930,7 +1930,7 @@ class Tests_User extends WP_UnitTestCase {
*
* @ticket 47509
*
* @return array $additional_profile_data The additional user data.
* @return array The additional user data.
*/
public function export_additional_user_profile_data_with_dup_name() {
$additional_profile_data = array(

View File

@ -222,7 +222,7 @@ class Tests_User_WpSendUserRequest extends WP_UnitTestCase {
* @since 4.9.9
*
* @param string $email_text Confirmation email text.
* @return string $email_text Filtered email text.
* @return string Filtered email text.
*/
public function modify_email_content( $email_text ) {
return 'Custom Email Content.';
@ -252,7 +252,7 @@ class Tests_User_WpSendUserRequest extends WP_UnitTestCase {
* @since 5.4.0
*
* @param string|array $headers The email headers.
* @return array $headers The new email headers.
* @return array The new email headers.
*/
public function modify_email_headers( $headers ) {
$headers = array(