From 905460bd5e6cc772d172879a8d12d2e79b0335dd Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sat, 10 Oct 2020 20:02:05 +0000 Subject: [PATCH] Docs: Standardise the type name for booleans and integers. This brings these docs inline with the documentation standards. Props ravipatel, justinahinon Fixes #51426 Built from https://develop.svn.wordpress.org/trunk@49120 git-svn-id: http://core.svn.wordpress.org/trunk@48882 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/media.php | 8 ++++---- wp-content/themes/twentyfourteen/inc/template-tags.php | 2 +- .../themes/twentyseventeen/inc/template-tags.php | 2 +- wp-content/themes/twentythirteen/functions.php | 2 +- wp-content/themes/twentytwenty/inc/template-tags.php | 4 ++-- wp-includes/Text/Diff.php | 10 +++++----- wp-includes/blocks.php | 4 ++-- wp-includes/class-http.php | 2 +- wp-includes/class-wp-block-styles-registry.php | 4 ++-- wp-includes/class-wp-block-type.php | 2 +- wp-includes/class-wp-hook.php | 2 +- wp-includes/class-wp-http-requests-hooks.php | 2 +- wp-includes/class-wp-simplepie-file.php | 6 +++--- wp-includes/class-wp-simplepie-sanitize-kses.php | 2 +- wp-includes/class-wp-widget.php | 4 ++-- wp-includes/class-wp-xmlrpc-server.php | 4 ++-- wp-includes/pomo/po.php | 4 ++-- wp-includes/pomo/streams.php | 4 ++-- wp-includes/pomo/translations.php | 2 +- wp-includes/rest-api.php | 6 +++--- .../endpoints/class-wp-rest-posts-controller.php | 6 +++--- .../endpoints/class-wp-rest-users-controller.php | 4 ++-- wp-includes/version.php | 2 +- wp-includes/widgets/class-wp-widget-custom-html.php | 4 ++-- wp-includes/widgets/class-wp-widget-media.php | 4 ++-- wp-includes/widgets/class-wp-widget-text.php | 4 ++-- 26 files changed, 50 insertions(+), 50 deletions(-) diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index aab55386f5..65890ac578 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -176,7 +176,7 @@ function get_image_send_to_editor( $id, $caption, $title, $align, $url = '', $re * @since 2.6.0 * * @param string $html The image HTML markup to send. - * @param integer $id Image attachment ID. + * @param int $id Image attachment ID. * @param string $caption Image caption. * @param string $title Image title attribute (not used). * @param string $align Image CSS alignment property. @@ -1319,7 +1319,7 @@ function image_attachment_fields_to_save( $post, $attachment ) { * @since 2.5.0 * * @param string $html - * @param integer $attachment_id + * @param int $attachment_id * @param array $attachment * @return string */ @@ -2275,7 +2275,7 @@ function media_upload_form( $errors = null ) { * * @param string $type * @param object $errors - * @param integer $id + * @param int $id */ function media_upload_type_form( $type = 'file', $errors = null, $id = null ) { @@ -2349,7 +2349,7 @@ function media_upload_type_form( $type = 'file', $errors = null, $id = null ) { * * @param string $type * @param object $errors - * @param integer $id + * @param int $id */ function media_upload_type_url_form( $type = null, $errors = null, $id = null ) { if ( null === $type ) { diff --git a/wp-content/themes/twentyfourteen/inc/template-tags.php b/wp-content/themes/twentyfourteen/inc/template-tags.php index 413457f87d..09e7fbc673 100644 --- a/wp-content/themes/twentyfourteen/inc/template-tags.php +++ b/wp-content/themes/twentyfourteen/inc/template-tags.php @@ -128,7 +128,7 @@ endif; * * @since Twenty Fourteen 1.0 * - * @return boolean true if blog has more than 1 category + * @return bool true if blog has more than 1 category */ function twentyfourteen_categorized_blog() { $all_the_cool_cats = get_transient( 'twentyfourteen_category_count' ); diff --git a/wp-content/themes/twentyseventeen/inc/template-tags.php b/wp-content/themes/twentyseventeen/inc/template-tags.php index c31d8bfbcc..a83acf7205 100644 --- a/wp-content/themes/twentyseventeen/inc/template-tags.php +++ b/wp-content/themes/twentyseventeen/inc/template-tags.php @@ -127,7 +127,7 @@ endif; * Display a front page section. * * @param WP_Customize_Partial $partial Partial associated with a selective refresh request. - * @param integer $id Front page section to display. + * @param int $id Front page section to display. */ function twentyseventeen_front_page_section( $partial = null, $id = 0 ) { if ( is_a( $partial, 'WP_Customize_Partial' ) ) { diff --git a/wp-content/themes/twentythirteen/functions.php b/wp-content/themes/twentythirteen/functions.php index 1df094935b..ae7c956249 100644 --- a/wp-content/themes/twentythirteen/functions.php +++ b/wp-content/themes/twentythirteen/functions.php @@ -515,7 +515,7 @@ if ( ! function_exists( 'twentythirteen_entry_date' ) ) : * * @since Twenty Thirteen 1.0 * - * @param boolean $echo (optional) Whether to echo the date. Default true. + * @param bool $echo (optional) Whether to echo the date. Default true. * @return string The HTML-formatted post date. */ function twentythirteen_entry_date( $echo = true ) { diff --git a/wp-content/themes/twentytwenty/inc/template-tags.php b/wp-content/themes/twentytwenty/inc/template-tags.php index 5e3de17f7d..ced859d278 100644 --- a/wp-content/themes/twentytwenty/inc/template-tags.php +++ b/wp-content/themes/twentytwenty/inc/template-tags.php @@ -26,7 +26,7 @@ * Displays the site logo, either text or image. * * @param array $args Arguments for displaying the site logo either as an image or text. - * @param boolean $echo Echo or return the HTML. + * @param bool $echo Echo or return the HTML. * @return string Compiled HTML based on our arguments. */ function twentytwenty_site_logo( $args = array(), $echo = true ) { @@ -88,7 +88,7 @@ function twentytwenty_site_logo( $args = array(), $echo = true ) { /** * Displays the site description. * - * @param boolean $echo Echo or return the html. + * @param bool $echo Echo or return the html. * @return string The HTML to display. */ function twentytwenty_site_description( $echo = true ) { diff --git a/wp-includes/Text/Diff.php b/wp-includes/Text/Diff.php index edcdd3ac3a..f9452f2600 100644 --- a/wp-includes/Text/Diff.php +++ b/wp-includes/Text/Diff.php @@ -75,7 +75,7 @@ class Text_Diff { * * @since Text_Diff 1.1.0 * - * @return integer The number of new lines + * @return int The number of new lines */ function countAddedLines() { @@ -94,7 +94,7 @@ class Text_Diff { * * @since Text_Diff 1.1.0 * - * @return integer The number of deleted lines + * @return int The number of deleted lines */ function countDeletedLines() { @@ -139,7 +139,7 @@ class Text_Diff { /** * Checks for an empty diff. * - * @return boolean True if two sequences were identical. + * @return bool True if two sequences were identical. */ function isEmpty() { @@ -156,7 +156,7 @@ class Text_Diff { * * This is mostly for diagnostic purposes. * - * @return integer The length of the LCS. + * @return int The length of the LCS. */ function lcs() { @@ -210,7 +210,7 @@ class Text_Diff { * with array_walk(). * * @param string $line The line to trim. - * @param integer $key The index of the line in the array. Not used. + * @param int $key The index of the line in the array. Not used. */ static function trimNewlines(&$line, $key) { diff --git a/wp-includes/blocks.php b/wp-includes/blocks.php index 3c83c00dc3..128e38a7e0 100644 --- a/wp-includes/blocks.php +++ b/wp-includes/blocks.php @@ -812,7 +812,7 @@ function block_version( $content ) { * @param array $style_properties Array containing the properties of the style name, * label, style (name of the stylesheet to be enqueued), * inline_style (string containing the CSS to be added). - * @return boolean True if the block style was registered with success and false otherwise. + * @return bool True if the block style was registered with success and false otherwise. */ function register_block_style( $block_name, $style_properties ) { return WP_Block_Styles_Registry::get_instance()->register( $block_name, $style_properties ); @@ -825,7 +825,7 @@ function register_block_style( $block_name, $style_properties ) { * * @param string $block_name Block type name including namespace. * @param array $block_style_name Block style name. - * @return boolean True if the block style was unregistered with success and false otherwise. + * @return bool True if the block style was unregistered with success and false otherwise. */ function unregister_block_style( $block_name, $block_style_name ) { return WP_Block_Styles_Registry::get_instance()->unregister( $block_name, $block_style_name ); diff --git a/wp-includes/class-http.php b/wp-includes/class-http.php index 8211408101..177f52675a 100644 --- a/wp-includes/class-http.php +++ b/wp-includes/class-http.php @@ -1076,7 +1076,7 @@ class WP_Http { * @since 3.7.0 * * @param string $maybe_ip A suspected IP address. - * @return integer|bool Upon success, '4' or '6' to represent a IPv4 or IPv6 address, false upon failure + * @return int|bool Upon success, '4' or '6' to represent a IPv4 or IPv6 address, false upon failure */ public static function is_ip_address( $maybe_ip ) { if ( preg_match( '/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/', $maybe_ip ) ) { diff --git a/wp-includes/class-wp-block-styles-registry.php b/wp-includes/class-wp-block-styles-registry.php index f56d0e2d72..df6945fd34 100644 --- a/wp-includes/class-wp-block-styles-registry.php +++ b/wp-includes/class-wp-block-styles-registry.php @@ -38,7 +38,7 @@ final class WP_Block_Styles_Registry { * @param array $style_properties Array containing the properties of the style name, label, * style (name of the stylesheet to be enqueued), * inline_style (string containing the CSS to be added). - * @return boolean True if the block style was registered with success and false otherwise. + * @return bool True if the block style was registered with success and false otherwise. */ public function register( $block_name, $style_properties ) { @@ -69,7 +69,7 @@ final class WP_Block_Styles_Registry { * * @param string $block_name Block type name including namespace. * @param string $block_style_name Block style name. - * @return boolean True if the block style was unregistered with success and false otherwise. + * @return bool True if the block style was unregistered with success and false otherwise. */ public function unregister( $block_name, $block_style_name ) { if ( ! $this->is_registered( $block_name, $block_style_name ) ) { diff --git a/wp-includes/class-wp-block-type.php b/wp-includes/class-wp-block-type.php index 93e1615f62..79b0e3e6d1 100644 --- a/wp-includes/class-wp-block-type.php +++ b/wp-includes/class-wp-block-type.php @@ -192,7 +192,7 @@ class WP_Block_Type { * * @since 5.0.0 * - * @return boolean Whether block type is dynamic. + * @return bool Whether block type is dynamic. */ public function is_dynamic() { return is_callable( $this->render_callback ); diff --git a/wp-includes/class-wp-hook.php b/wp-includes/class-wp-hook.php index f7446222b1..e2c9cf2368 100644 --- a/wp-includes/class-wp-hook.php +++ b/wp-includes/class-wp-hook.php @@ -490,7 +490,7 @@ final class WP_Hook implements Iterator, ArrayAccess { * * @link https://www.php.net/manual/en/iterator.valid.php * - * @return boolean + * @return bool Whether the current position is valid. */ public function valid() { return key( $this->callbacks ) !== null; diff --git a/wp-includes/class-wp-http-requests-hooks.php b/wp-includes/class-wp-http-requests-hooks.php index bea22886cb..6ef1730b31 100644 --- a/wp-includes/class-wp-http-requests-hooks.php +++ b/wp-includes/class-wp-http-requests-hooks.php @@ -45,7 +45,7 @@ class WP_HTTP_Requests_Hooks extends Requests_Hooks { * * @param string $hook Hook name. * @param array $parameters Parameters to pass to callbacks. - * @return boolean True if hooks were run, false if nothing was hooked. + * @return bool True if hooks were run, false if nothing was hooked. */ public function dispatch( $hook, $parameters = array() ) { $result = parent::dispatch( $hook, $parameters ); diff --git a/wp-includes/class-wp-simplepie-file.php b/wp-includes/class-wp-simplepie-file.php index 6d43a3b013..adc3ae5a45 100644 --- a/wp-includes/class-wp-simplepie-file.php +++ b/wp-includes/class-wp-simplepie-file.php @@ -23,13 +23,13 @@ class WP_SimplePie_File extends SimplePie_File { * @since 3.2.0 Updated to use a PHP5 constructor. * * @param string $url Remote file URL. - * @param integer $timeout Optional. How long the connection should stay open in seconds. + * @param int $timeout Optional. How long the connection should stay open in seconds. * Default 10. - * @param integer $redirects Optional. The number of allowed redirects. Default 5. + * @param int $redirects Optional. The number of allowed redirects. Default 5. * @param string|array $headers Optional. Array or string of headers to send with the request. * Default null. * @param string $useragent Optional. User-agent value sent. Default null. - * @param boolean $force_fsockopen Optional. Whether to force opening internet or unix domain socket + * @param bool $force_fsockopen Optional. Whether to force opening internet or unix domain socket * connection or not. Default false. */ public function __construct( $url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false ) { diff --git a/wp-includes/class-wp-simplepie-sanitize-kses.php b/wp-includes/class-wp-simplepie-sanitize-kses.php index 4a4fed6739..ae462bf1cb 100644 --- a/wp-includes/class-wp-simplepie-sanitize-kses.php +++ b/wp-includes/class-wp-simplepie-sanitize-kses.php @@ -27,7 +27,7 @@ class WP_SimplePie_Sanitize_KSES extends SimplePie_Sanitize { * @since 3.5.0 * * @param mixed $data The data that needs to be sanitized. - * @param integer $type The type of data that it's supposed to be. + * @param int $type The type of data that it's supposed to be. * @param string $base Optional. The `xml:base` value to use when converting relative * URLs to absolute ones. Default empty. * @return mixed Sanitized data. diff --git a/wp-includes/class-wp-widget.php b/wp-includes/class-wp-widget.php index b2c4cbbc06..db8e205513 100644 --- a/wp-includes/class-wp-widget.php +++ b/wp-includes/class-wp-widget.php @@ -544,8 +544,8 @@ class WP_Widget { * * @since 2.8.0 * - * @param integer $number Optional. The unique order number of this widget instance - * compared to other instances of the same class. Default -1. + * @param int $number Optional. The unique order number of this widget instance + * compared to other instances of the same class. Default -1. */ public function _register_one( $number = -1 ) { wp_register_sidebar_widget( $this->id, $this->name, $this->_get_display_callback(), $this->widget_options, array( 'number' => $number ) ); diff --git a/wp-includes/class-wp-xmlrpc-server.php b/wp-includes/class-wp-xmlrpc-server.php index c653151437..6294c33188 100644 --- a/wp-includes/class-wp-xmlrpc-server.php +++ b/wp-includes/class-wp-xmlrpc-server.php @@ -5574,8 +5574,8 @@ class wp_xmlrpc_server extends IXR_Server { * * @since 2.8.0 * - * @param integer $post_ID Post ID. - * @param array $enclosure Enclosure data. + * @param int $post_ID Post ID. + * @param array $enclosure Enclosure data. */ public function add_enclosure_if_new( $post_ID, $enclosure ) { if ( is_array( $enclosure ) && isset( $enclosure['url'] ) && isset( $enclosure['length'] ) && isset( $enclosure['type'] ) ) { diff --git a/wp-includes/pomo/po.php b/wp-includes/pomo/po.php index 9b72aea6e0..5030afb5df 100644 --- a/wp-includes/pomo/po.php +++ b/wp-includes/pomo/po.php @@ -283,7 +283,7 @@ if ( ! class_exists( 'PO', false ) ) : /** * @param string $filename - * @return boolean + * @return bool */ function import_from_file( $filename ) { $f = fopen( $filename, 'r' ); @@ -454,7 +454,7 @@ if ( ! class_exists( 'PO', false ) ) : /** * @param resource $f * @param string $action - * @return boolean + * @return bool */ function read_line( $f, $action = 'read' ) { static $last_line = ''; diff --git a/wp-includes/pomo/streams.php b/wp-includes/pomo/streams.php index 52228d9120..89e13a8f4b 100644 --- a/wp-includes/pomo/streams.php +++ b/wp-includes/pomo/streams.php @@ -62,7 +62,7 @@ if ( ! class_exists( 'POMO_Reader', false ) ) : /** * Reads an array of 32-bit Integers from the Stream * - * @param integer $count How many elements should be read + * @param int $count How many elements should be read * @return mixed Array of integers or false if there isn't * enough data or on error */ @@ -175,7 +175,7 @@ if ( ! class_exists( 'POMO_FileReader', false ) ) : /** * @param int $pos - * @return boolean + * @return bool */ function seekto( $pos ) { if ( -1 == fseek( $this->_f, $pos, SEEK_SET ) ) { diff --git a/wp-includes/pomo/translations.php b/wp-includes/pomo/translations.php index f4a125e32c..d99037eaed 100644 --- a/wp-includes/pomo/translations.php +++ b/wp-includes/pomo/translations.php @@ -116,7 +116,7 @@ if ( ! class_exists( 'Translations', false ) ) : * This function should be overridden by the subclasses. For example MO/PO can derive the logic * from their headers. * - * @param integer $count number of items + * @param int $count number of items */ function select_plural_form( $count ) { return 1 == $count ? 0 : 1; diff --git a/wp-includes/rest-api.php b/wp-includes/rest-api.php index 0da4aeae36..c3c8a09d03 100644 --- a/wp-includes/rest-api.php +++ b/wp-includes/rest-api.php @@ -1244,7 +1244,7 @@ function rest_get_date_with_gmt( $date, $is_utc = false ) { * * @since 4.7.0 * - * @return integer 401 if the user is not logged in, 403 if the user is logged in. + * @return int 401 if the user is not logged in, 403 if the user is logged in. */ function rest_authorization_required_code() { return is_user_logged_in() ? 403 : 401; @@ -1341,7 +1341,7 @@ function rest_is_ip_address( $ip ) { * @since 4.7.0 * * @param bool|string|int $value The value being evaluated. - * @return boolean Returns the proper associated boolean value. + * @return bool Returns the proper associated boolean value. */ function rest_sanitize_boolean( $value ) { // String values are translated to `true`; make sure 'false' is false. @@ -1362,7 +1362,7 @@ function rest_sanitize_boolean( $value ) { * @since 4.7.0 * * @param bool|string $maybe_bool The value being evaluated. - * @return boolean True if a boolean, otherwise false. + * @return bool True if a boolean, otherwise false. */ function rest_is_boolean( $maybe_bool ) { if ( is_bool( $maybe_bool ) ) { diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php index 90de111538..76a924cf96 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php @@ -1370,9 +1370,9 @@ class WP_REST_Posts_Controller extends WP_REST_Controller { * @since 4.7.0 * @since 4.9.0 Added the `$validate` parameter. * - * @param string $template Page template filename. - * @param integer $post_id Post ID. - * @param bool $validate Whether to validate that the template selected is valid. + * @param string $template Page template filename. + * @param int $post_id Post ID. + * @param bool $validate Whether to validate that the template selected is valid. */ public function handle_template( $template, $post_id, $validate = false ) { diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php index d8a969705c..cac342661b 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php @@ -1173,8 +1173,8 @@ class WP_REST_Users_Controller extends WP_REST_Controller { * * @since 4.7.0 * - * @param integer $user_id User ID. - * @param array $roles New user roles. + * @param int $user_id User ID. + * @param array $roles New user roles. * @return true|WP_Error True if the current user is allowed to make the role change, * otherwise a WP_Error object. */ diff --git a/wp-includes/version.php b/wp-includes/version.php index a14771fbc8..833347560c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.6-alpha-49119'; +$wp_version = '5.6-alpha-49120'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-includes/widgets/class-wp-widget-custom-html.php b/wp-includes/widgets/class-wp-widget-custom-html.php index b9140e65e8..a3314280b3 100644 --- a/wp-includes/widgets/class-wp-widget-custom-html.php +++ b/wp-includes/widgets/class-wp-widget-custom-html.php @@ -58,8 +58,8 @@ class WP_Widget_Custom_HTML extends WP_Widget { * * @since 4.9.0 * - * @param integer $number Optional. The unique order number of this widget instance - * compared to other instances of the same class. Default -1. + * @param int $number Optional. The unique order number of this widget instance + * compared to other instances of the same class. Default -1. */ public function _register_one( $number = -1 ) { parent::_register_one( $number ); diff --git a/wp-includes/widgets/class-wp-widget-media.php b/wp-includes/widgets/class-wp-widget-media.php index 65c5b3a8ea..9c0dc05275 100644 --- a/wp-includes/widgets/class-wp-widget-media.php +++ b/wp-includes/widgets/class-wp-widget-media.php @@ -96,8 +96,8 @@ abstract class WP_Widget_Media extends WP_Widget { * * @since 4.8.0 * - * @param integer $number Optional. The unique order number of this widget instance - * compared to other instances of the same class. Default -1. + * @param int $number Optional. The unique order number of this widget instance + * compared to other instances of the same class. Default -1. */ public function _register_one( $number = -1 ) { parent::_register_one( $number ); diff --git a/wp-includes/widgets/class-wp-widget-text.php b/wp-includes/widgets/class-wp-widget-text.php index 8cac1b9185..c653e1b4eb 100644 --- a/wp-includes/widgets/class-wp-widget-text.php +++ b/wp-includes/widgets/class-wp-widget-text.php @@ -45,8 +45,8 @@ class WP_Widget_Text extends WP_Widget { /** * Add hooks for enqueueing assets when registering all widget instances of this widget class. * - * @param integer $number Optional. The unique order number of this widget instance - * compared to other instances of the same class. Default -1. + * @param int $number Optional. The unique order number of this widget instance + * compared to other instances of the same class. Default -1. */ public function _register_one( $number = -1 ) { parent::_register_one( $number );