From b64f812a598687d02923b36cbe476a2aabcdf9a0 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sat, 25 May 2019 21:58:18 +0000 Subject: [PATCH] Docs: Switch to the more common syntax for variadic function documentation. See #37402 git-svn-id: https://develop.svn.wordpress.org/trunk@45418 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-user.php | 10 +++++----- src/wp-includes/deprecated.php | 2 +- src/wp-includes/formatting.php | 4 ++-- src/wp-includes/plugin.php | 12 ++++++------ src/wp-includes/theme.php | 10 +++++----- src/wp-includes/wp-db.php | 8 ++++---- tests/phpunit/includes/abstract-testcase.php | 2 +- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/wp-includes/class-wp-user.php b/src/wp-includes/class-wp-user.php index 620aecd024..29c75b60f8 100644 --- a/src/wp-includes/class-wp-user.php +++ b/src/wp-includes/class-wp-user.php @@ -721,11 +721,11 @@ class WP_User { * * @see map_meta_cap() * - * @param string $cap Capability name. - * @param int $object_id,... Optional. ID of a specific object to check against if `$cap` is a "meta" capability. - * Meta capabilities such as `edit_post` and `edit_user` are capabilities used by - * by the `map_meta_cap()` function to map to primitive capabilities that a user or - * role has, such as `edit_posts` and `edit_others_posts`. + * @param string $cap Capability name. + * @param int ...$object_id Optional. ID of a specific object to check against if `$cap` is a "meta" capability. + * Meta capabilities such as `edit_post` and `edit_user` are capabilities used by + * by the `map_meta_cap()` function to map to primitive capabilities that a user or + * role has, such as `edit_posts` and `edit_others_posts`. * @return bool Whether the user has the given capability, or, if `$object_id` is passed, whether the user has * the given capability for that object. */ diff --git a/src/wp-includes/deprecated.php b/src/wp-includes/deprecated.php index f59cff1ea4..d928a2891f 100644 --- a/src/wp-includes/deprecated.php +++ b/src/wp-includes/deprecated.php @@ -2109,7 +2109,7 @@ function attribute_escape( $text ) { * @param string|int $name Widget ID. * @param callable $output_callback Run when widget is called. * @param string $classname Optional. Classname widget option. Default empty. - * @param mixed $params ,... Widget parameters. + * @param mixed ...$params Widget parameters. */ function register_sidebar_widget($name, $output_callback, $classname = '') { _deprecated_function( __FUNCTION__, '2.8.0', 'wp_register_sidebar_widget()' ); diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index 7d73481eab..3d51852798 100644 --- a/src/wp-includes/formatting.php +++ b/src/wp-includes/formatting.php @@ -4811,8 +4811,8 @@ function wp_pre_kses_less_than_callback( $matches ) { * @since 2.5.0 * @link https://secure.php.net/sprintf * - * @param string $pattern The string which formatted args are inserted. - * @param mixed $args ,... Arguments to be formatted into the $pattern string. + * @param string $pattern The string which formatted args are inserted. + * @param mixed ...$args Arguments to be formatted into the $pattern string. * @return string The formatted string. */ function wp_sprintf( $pattern ) { diff --git a/src/wp-includes/plugin.php b/src/wp-includes/plugin.php index 879bb12fd4..7146e2ed20 100644 --- a/src/wp-includes/plugin.php +++ b/src/wp-includes/plugin.php @@ -170,9 +170,9 @@ function has_filter( $tag, $function_to_check = false ) { * @global array $wp_filter Stores all of the filters. * @global array $wp_current_filter Stores the list of current filters with the current one last. * - * @param string $tag The name of the filter hook. - * @param mixed $value The value on which the filters hooked to `$tag` are applied on. - * @param mixed $var,... Additional variables passed to the functions hooked to `$tag`. + * @param string $tag The name of the filter hook. + * @param mixed $value The value on which the filters hooked to `$tag` are applied on. + * @param mixed ...$var Additional variables passed to the functions hooked to `$tag`. * @return mixed The filtered value after all hooked functions are applied to it. */ function apply_filters( $tag, $value ) { @@ -421,9 +421,9 @@ function add_action( $tag, $function_to_add, $priority = 10, $accepted_args = 1 * @global array $wp_actions Increments the amount of times action was triggered. * @global array $wp_current_filter Stores the list of current filters with the current one last * - * @param string $tag The name of the action to be executed. - * @param mixed $arg,... Optional. Additional arguments which are passed on to the - * functions hooked to the action. Default empty. + * @param string $tag The name of the action to be executed. + * @param mixed ...$arg Optional. Additional arguments which are passed on to the + * functions hooked to the action. Default empty. */ function do_action( $tag, $arg = '' ) { global $wp_filter, $wp_actions, $wp_current_filter; diff --git a/src/wp-includes/theme.php b/src/wp-includes/theme.php index a6bf043f03..1682fdbdab 100644 --- a/src/wp-includes/theme.php +++ b/src/wp-includes/theme.php @@ -2330,11 +2330,11 @@ function get_theme_starter_content() { * * @global array $_wp_theme_features * - * @param string $feature The feature being added. Likely core values include 'post-formats', - * 'post-thumbnails', 'html5', 'custom-logo', 'custom-header-uploads', - * 'custom-header', 'custom-background', 'title-tag', 'starter-content', - * 'responsive-embeds', etc. - * @param mixed $args,... Optional extra arguments to pass along with certain features. + * @param string $feature The feature being added. Likely core values include 'post-formats', + * 'post-thumbnails', 'html5', 'custom-logo', 'custom-header-uploads', + * 'custom-header', 'custom-background', 'title-tag', 'starter-content', + * 'responsive-embeds', etc. + * @param mixed ...$args Optional extra arguments to pass along with certain features. * @return void|bool False on failure, void otherwise. */ function add_theme_support( $feature ) { diff --git a/src/wp-includes/wp-db.php b/src/wp-includes/wp-db.php index 39e9331692..fd997ad661 100644 --- a/src/wp-includes/wp-db.php +++ b/src/wp-includes/wp-db.php @@ -1286,10 +1286,10 @@ class wpdb { * @link https://secure.php.net/sprintf Description of syntax. * @since 2.3.0 * - * @param string $query Query statement with sprintf()-like placeholders - * @param array|mixed $args The array of variables to substitute into the query's placeholders if being called with an array of arguments, - * or the first variable to substitute into the query's placeholders if being called with individual arguments. - * @param mixed $args,... further variables to substitute into the query's placeholders if being called wih individual arguments. + * @param string $query Query statement with sprintf()-like placeholders + * @param array|mixed $args The array of variables to substitute into the query's placeholders if being called with an array of arguments, + * or the first variable to substitute into the query's placeholders if being called with individual arguments. + * @param mixed ...$args further variables to substitute into the query's placeholders if being called wih individual arguments. * @return string|void Sanitized query string, if there is a query to prepare. */ public function prepare( $query, $args ) { diff --git a/tests/phpunit/includes/abstract-testcase.php b/tests/phpunit/includes/abstract-testcase.php index 69c86bc3e3..c953aa5539 100644 --- a/tests/phpunit/includes/abstract-testcase.php +++ b/tests/phpunit/includes/abstract-testcase.php @@ -908,7 +908,7 @@ abstract class WP_UnitTestCase_Base extends PHPUnit_Framework_TestCase { * @since 2.5.0 * @since 3.8.0 Moved from `Tests_Query_Conditionals` to `WP_UnitTestCase`. * - * @param string $prop,... Any number of WP_Query properties that are expected to be true for the current request. + * @param string ...$prop Any number of WP_Query properties that are expected to be true for the current request. */ public function assertQueryTrue() { global $wp_query;