From a0e373ef80094651621d3a6d649e1915279ba250 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sat, 27 Jun 2015 01:03:25 +0000 Subject: [PATCH] For doc block types, favor `bool` over the few remaining `boolean`s See #32444. Built from https://develop.svn.wordpress.org/trunk@32964 git-svn-id: http://core.svn.wordpress.org/trunk@32935 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/export.php | 2 +- wp-admin/includes/file.php | 16 +++++------ wp-admin/includes/image-edit.php | 6 ++-- wp-admin/includes/media.php | 12 ++++---- wp-admin/includes/template.php | 6 ++-- wp-includes/class-IXR.php | 2 +- wp-includes/class-http.php | 6 ++-- wp-includes/class-wp-customize-manager.php | 2 +- wp-includes/class-wp-customize-widgets.php | 2 +- wp-includes/class-wp-image-editor-gd.php | 26 ++++++++--------- wp-includes/class-wp-image-editor-imagick.php | 28 +++++++++---------- wp-includes/class-wp-image-editor.php | 26 ++++++++--------- wp-includes/class.wp-dependencies.php | 2 +- wp-includes/comment.php | 4 +-- wp-includes/deprecated.php | 2 +- wp-includes/link-template.php | 6 ++-- wp-includes/plugin.php | 2 +- wp-includes/theme.php | 2 +- wp-includes/version.php | 2 +- wp-includes/wp-db.php | 2 +- wp-signup.php | 4 +-- 21 files changed, 80 insertions(+), 80 deletions(-) diff --git a/wp-admin/includes/export.php b/wp-admin/includes/export.php index 68a3942843..98989324e1 100644 --- a/wp-admin/includes/export.php +++ b/wp-admin/includes/export.php @@ -319,7 +319,7 @@ function export_wp( $args = array() ) { * * @param bool $return_me * @param string $meta_key - * @return boolean + * @return bool */ function wxr_filter_postmeta( $return_me, $meta_key ) { if ( '_edit_lock' == $meta_key ) diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index 43545e2d97..df489491e6 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -837,7 +837,7 @@ function copy_dir($from, $to, $skip_list = array() ) { * the `WP_Filesystem_*()` classes. Default false. * @param string|false $context Optional. Context for get_filesystem_method(). Default false. * @param bool $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable. Default false. - * @return null|boolean false on failure, true on success. + * @return null|bool false on failure, true on success. */ function WP_Filesystem( $args = false, $context = false, $allow_relaxed_file_ownership = false ) { global $wp_filesystem; @@ -996,13 +996,13 @@ function get_filesystem_method( $args = array(), $context = false, $allow_relaxe * * @todo Properly mark optional arguments as such * - * @param string $form_post the URL to post the form to - * @param string $type the chosen Filesystem method in use - * @param boolean $error if the current request has failed to connect - * @param string $context The directory which is needed access to, The write-test will be performed on this directory by get_filesystem_method() - * @param array $extra_fields Extra POST fields which should be checked for to be included in the post. - * @param bool $allow_relaxed_file_ownership Whether to allow Group/World writable. - * @return boolean False on failure. True on success. + * @param string $form_post the URL to post the form to + * @param string $type the chosen Filesystem method in use + * @param bool $error if the current request has failed to connect + * @param string $context The directory which is needed access to, The write-test will be performed on this directory by get_filesystem_method() + * @param array $extra_fields Extra POST fields which should be checked for to be included in the post. + * @param bool $allow_relaxed_file_ownership Whether to allow Group/World writable. + * @return bool False on failure. True on success. */ function request_filesystem_credentials($form_post, $type = '', $error = false, $context = false, $extra_fields = null, $allow_relaxed_file_ownership = false ) { diff --git a/wp-admin/includes/image-edit.php b/wp-admin/includes/image-edit.php index bab1a8c0fc..c15562f310 100644 --- a/wp-admin/includes/image-edit.php +++ b/wp-admin/includes/image-edit.php @@ -208,7 +208,7 @@ function wp_image_editor($post_id, $msg = false) { * @param WP_Image_Editor $image * @param string $mime_type * @param int $post_id - * @return boolean + * @return bool */ function wp_stream_image( $image, $mime_type, $post_id ) { if ( $image instanceof WP_Image_Editor ) { @@ -264,7 +264,7 @@ function wp_stream_image( $image, $mime_type, $post_id ) { * @param WP_Image_Editor $image * @param string $mime_type * @param int $post_id - * @return boolean + * @return bool */ function wp_save_image_file( $filename, $image, $mime_type, $post_id ) { if ( $image instanceof WP_Image_Editor ) { @@ -552,7 +552,7 @@ function image_edit_apply_changes( $image, $changes ) { * in $_REQUEST['history'] * * @param int $post_id - * @return boolean + * @return bool */ function stream_preview_image( $post_id ) { $post = get_post( $post_id ); diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index cf1beb6d8d..4a2e60566b 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -1493,7 +1493,7 @@ function get_media_item( $attachment_id, $args = null ) { } if ( 'image' == $type && $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) ) && post_type_supports( get_post_type( $calling_post_id ), 'thumbnail' ) && get_post_thumbnail_id( $calling_post_id ) != $attachment_id ) { - + $calling_post = get_post( $calling_post_id ); $calling_post_type_object = get_post_type_object( $calling_post->post_type ); @@ -1743,11 +1743,11 @@ function media_upload_header() { $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0; - if ( ! empty( $post_id ) ) { - $post_type = get_post_type( $post_id ); + if ( ! empty( $post_id ) ) { + $post_type = get_post_type( $post_id ); } else { - $post_type = ''; - } + $post_type = ''; + } echo ''; if ( empty( $_GET['chromeless'] ) ) { @@ -3024,7 +3024,7 @@ function wp_read_video_metadata( $file ) { * @since 3.6.0 * * @param string $file Path to file. - * @return array|boolean Returns array of metadata, if found. + * @return array|bool Returns array of metadata, if found. */ function wp_read_audio_metadata( $file ) { if ( ! file_exists( $file ) ) diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 1fd9283462..82155cfdbc 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -1482,9 +1482,9 @@ function get_settings_errors( $setting = '', $sanitize = false ) { * * @since 3.0.0 * - * @param string $setting Optional slug title of a specific setting who's errors you want. - * @param boolean $sanitize Whether to re-sanitize the setting value before returning errors. - * @param boolean $hide_on_update If set to true errors will not be shown if the settings page has already been submitted. + * @param string $setting Optional slug title of a specific setting who's errors you want. + * @param bool $sanitize Whether to re-sanitize the setting value before returning errors. + * @param bool $hide_on_update If set to true errors will not be shown if the settings page has already been submitted. */ function settings_errors( $setting = '', $sanitize = false, $hide_on_update = false ) { diff --git a/wp-includes/class-IXR.php b/wp-includes/class-IXR.php index 5930f562e4..d2a6391a64 100644 --- a/wp-includes/class-IXR.php +++ b/wp-includes/class-IXR.php @@ -152,7 +152,7 @@ class IXR_Value { * Checks whether or not the supplied array is a struct or not * * @param array $array - * @return boolean + * @return bool */ function isStruct($array) { diff --git a/wp-includes/class-http.php b/wp-includes/class-http.php index 206d406539..5c0829700b 100644 --- a/wp-includes/class-http.php +++ b/wp-includes/class-http.php @@ -1255,7 +1255,7 @@ class WP_Http_Streams { * @since 2.7.0 * @since 3.7.0 Combined with the fsockopen transport and switched to stream_socket_client(). * - * @return boolean False means this class can not be used, true means it can. + * @return bool False means this class can not be used, true means it can. */ public static function test( $args = array() ) { if ( ! function_exists( 'stream_socket_client' ) ) @@ -1634,7 +1634,7 @@ class WP_Http_Curl { * @static * @since 2.7.0 * - * @return boolean False means this class can not be used, true means it can. + * @return bool False means this class can not be used, true means it can. */ public static function test( $args = array() ) { if ( ! function_exists( 'curl_init' ) || ! function_exists( 'curl_exec' ) ) @@ -2009,7 +2009,7 @@ class WP_Http_Cookie { * @since 2.8.0 * * @param string $url URL you intend to send this cookie to - * @return boolean true if allowed, false otherwise. + * @return bool true if allowed, false otherwise. */ public function test( $url ) { if ( is_null( $this->name ) ) diff --git a/wp-includes/class-wp-customize-manager.php b/wp-includes/class-wp-customize-manager.php index 7f778ebbea..eddf652137 100644 --- a/wp-includes/class-wp-customize-manager.php +++ b/wp-includes/class-wp-customize-manager.php @@ -38,7 +38,7 @@ final class WP_Customize_Manager { /** * Whether this is a Customizer pageload. * - * @var boolean + * @var bool */ protected $previewing = false; diff --git a/wp-includes/class-wp-customize-widgets.php b/wp-includes/class-wp-customize-widgets.php index 59db32b5a8..cf93bb50c9 100644 --- a/wp-includes/class-wp-customize-widgets.php +++ b/wp-includes/class-wp-customize-widgets.php @@ -1431,7 +1431,7 @@ final class WP_Customize_Widgets { * @access protected * * @param string $option_name Option name. - * @return boolean Whether the option capture is ignored. + * @return bool Whether the option capture is ignored. */ protected function is_option_capture_ignored( $option_name ) { return ( 0 === strpos( $option_name, '_transient_' ) ); diff --git a/wp-includes/class-wp-image-editor-gd.php b/wp-includes/class-wp-image-editor-gd.php index 3498bb2827..0f66c0eeaf 100644 --- a/wp-includes/class-wp-image-editor-gd.php +++ b/wp-includes/class-wp-image-editor-gd.php @@ -87,7 +87,7 @@ class WP_Image_Editor_GD extends WP_Image_Editor { * @since 3.5.0 * @access protected * - * @return boolean|WP_Error True if loaded successfully; WP_Error on failure. + * @return bool|WP_Error True if loaded successfully; WP_Error on failure. */ public function load() { if ( $this->image ) @@ -160,7 +160,7 @@ class WP_Image_Editor_GD extends WP_Image_Editor { * * @param int|null $max_w Image width. * @param int|null $max_h Image height. - * @param boolean $crop + * @param bool $crop * @return true|WP_Error */ public function resize( $max_w, $max_h, $crop = false ) { @@ -272,14 +272,14 @@ class WP_Image_Editor_GD extends WP_Image_Editor { * @since 3.5.0 * @access public * - * @param int $src_x The start x position to crop from. - * @param int $src_y The start y position to crop from. - * @param int $src_w The width to crop. - * @param int $src_h The height to crop. - * @param int $dst_w Optional. The destination width. - * @param int $dst_h Optional. The destination height. - * @param boolean $src_abs Optional. If the source crop points are absolute. - * @return boolean|WP_Error + * @param int $src_x The start x position to crop from. + * @param int $src_y The start y position to crop from. + * @param int $src_w The width to crop. + * @param int $src_h The height to crop. + * @param int $dst_w Optional. The destination width. + * @param int $dst_h Optional. The destination height. + * @param bool $src_abs Optional. If the source crop points are absolute. + * @return bool|WP_Error */ public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false ) { // If destination width/height isn't specified, use same as @@ -344,8 +344,8 @@ class WP_Image_Editor_GD extends WP_Image_Editor { * @since 3.5.0 * @access public * - * @param boolean $horz Flip along Horizontal Axis - * @param boolean $vert Flip along Vertical Axis + * @param bool $horz Flip along Horizontal Axis + * @param bool $vert Flip along Vertical Axis * @returns true|WP_Error */ public function flip( $horz, $vert ) { @@ -476,7 +476,7 @@ class WP_Image_Editor_GD extends WP_Image_Editor { * @param string|stream $filename * @param callable $function * @param array $arguments - * @return boolean + * @return bool */ protected function make_image( $filename, $function, $arguments ) { if ( wp_is_stream( $filename ) ) diff --git a/wp-includes/class-wp-image-editor-imagick.php b/wp-includes/class-wp-image-editor-imagick.php index 36edc4516a..143e710280 100644 --- a/wp-includes/class-wp-image-editor-imagick.php +++ b/wp-includes/class-wp-image-editor-imagick.php @@ -43,7 +43,7 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor { * @access public * * @param array $args - * @return boolean + * @return bool */ public static function test( $args = array() ) { @@ -93,7 +93,7 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor { * @access public * * @param string $mime_type - * @return boolean + * @return bool */ public static function supports_mime_type( $mime_type ) { $imagick_extension = strtoupper( self::get_extension( $mime_type ) ); @@ -233,8 +233,8 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor { * * @param int|null $max_w Image width. * @param int|null $max_h Image height. - * @param boolean $crop - * @return boolean|WP_Error + * @param bool $crop + * @return bool|WP_Error */ public function resize( $max_w, $max_h, $crop = false ) { if ( ( $this->size['width'] == $max_w ) && ( $this->size['height'] == $max_h ) ) @@ -338,14 +338,14 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor { * @since 3.5.0 * @access public * - * @param int $src_x The start x position to crop from. - * @param int $src_y The start y position to crop from. - * @param int $src_w The width to crop. - * @param int $src_h The height to crop. - * @param int $dst_w Optional. The destination width. - * @param int $dst_h Optional. The destination height. - * @param boolean $src_abs Optional. If the source crop points are absolute. - * @return boolean|WP_Error + * @param int $src_x The start x position to crop from. + * @param int $src_y The start y position to crop from. + * @param int $src_w The width to crop. + * @param int $src_h The height to crop. + * @param int $dst_w Optional. The destination width. + * @param int $dst_h Optional. The destination height. + * @param bool $src_abs Optional. If the source crop points are absolute. + * @return bool|WP_Error */ public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false ) { if ( $src_abs ) { @@ -411,8 +411,8 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor { * @since 3.5.0 * @access public * - * @param boolean $horz Flip along Horizontal Axis - * @param boolean $vert Flip along Vertical Axis + * @param bool $horz Flip along Horizontal Axis + * @param bool $vert Flip along Vertical Axis * @returns true|WP_Error */ public function flip( $horz, $vert ) { diff --git a/wp-includes/class-wp-image-editor.php b/wp-includes/class-wp-image-editor.php index 80be2acb81..f884937126 100644 --- a/wp-includes/class-wp-image-editor.php +++ b/wp-includes/class-wp-image-editor.php @@ -37,7 +37,7 @@ abstract class WP_Image_Editor { * @abstract * * @param array $args - * @return boolean + * @return bool */ public static function test( $args = array() ) { return false; @@ -54,7 +54,7 @@ abstract class WP_Image_Editor { * @abstract * * @param string $mime_type - * @return boolean + * @return bool */ public static function supports_mime_type( $mime_type ) { return false; @@ -67,7 +67,7 @@ abstract class WP_Image_Editor { * @access protected * @abstract * - * @return boolean|WP_Error True if loaded; WP_Error on failure. + * @return bool|WP_Error True if loaded; WP_Error on failure. */ abstract public function load(); @@ -97,8 +97,8 @@ abstract class WP_Image_Editor { * * @param int|null $max_w Image width. * @param int|null $max_h Image height. - * @param boolean $crop - * @return boolean|WP_Error + * @param bool $crop + * @return bool|WP_Error */ abstract public function resize( $max_w, $max_h, $crop = false ); @@ -135,8 +135,8 @@ abstract class WP_Image_Editor { * @param int $src_h The height to crop. * @param int $dst_w Optional. The destination width. * @param int $dst_h Optional. The destination height. - * @param boolean $src_abs Optional. If the source crop points are absolute. - * @return boolean|WP_Error + * @param bool $src_abs Optional. If the source crop points are absolute. + * @return bool|WP_Error */ abstract public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false ); @@ -148,7 +148,7 @@ abstract class WP_Image_Editor { * @abstract * * @param float $angle - * @return boolean|WP_Error + * @return bool|WP_Error */ abstract public function rotate( $angle ); @@ -159,9 +159,9 @@ abstract class WP_Image_Editor { * @access public * @abstract * - * @param boolean $horz Flip along Horizontal Axis - * @param boolean $vert Flip along Vertical Axis - * @return boolean|WP_Error + * @param bool $horz Flip along Horizontal Axis + * @param bool $vert Flip along Vertical Axis + * @return bool|WP_Error */ abstract public function flip( $horz, $vert ); @@ -173,7 +173,7 @@ abstract class WP_Image_Editor { * @abstract * * @param string $mime_type - * @return boolean|WP_Error + * @return bool|WP_Error */ abstract public function stream( $mime_type = null ); @@ -410,7 +410,7 @@ abstract class WP_Image_Editor { * @param string|stream $filename * @param callable $function * @param array $arguments - * @return boolean + * @return bool */ protected function make_image( $filename, $function, $arguments ) { if ( $stream = wp_is_stream( $filename ) ) { diff --git a/wp-includes/class.wp-dependencies.php b/wp-includes/class.wp-dependencies.php index 239f8f260b..918c53156f 100644 --- a/wp-includes/class.wp-dependencies.php +++ b/wp-includes/class.wp-dependencies.php @@ -331,7 +331,7 @@ class WP_Dependencies { * * @param array $queue An array of queued _WP_Dependency handle objects. * @param string $handle Name of the item. Should be unique. - * @return boolean Whether the handle is found after recursively searching the dependency tree. + * @return bool Whether the handle is found after recursively searching the dependency tree. */ protected function recurse_deps( $queue, $handle ) { foreach ( $queue as $queued ) { diff --git a/wp-includes/comment.php b/wp-includes/comment.php index ccd8464c51..2c2c834242 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -1493,8 +1493,8 @@ function separate_comments(&$comments) { * @global WP_Query $wp_query * * @param array $comments Optional array of comment objects. Defaults to $wp_query->comments - * @param int $per_page Optional comments per page. - * @param boolean $threaded Optional control over flat or threaded comments. + * @param int $per_page Optional comments per page. + * @param bool $threaded Optional control over flat or threaded comments. * @return int Number of comment pages. */ function get_comment_pages_count( $comments = null, $per_page = null, $threaded = null ) { diff --git a/wp-includes/deprecated.php b/wp-includes/deprecated.php index 19b059ad93..f5bc679c6a 100644 --- a/wp-includes/deprecated.php +++ b/wp-includes/deprecated.php @@ -2445,7 +2445,7 @@ function get_users_of_blog( $id = '' ) { * @deprecated 3.0.0 * @deprecated Use add_theme_support( 'automatic-feed-links' ) * - * @param boolean $add Optional, default is true. Add or remove links. Defaults to true. + * @param bool $add Optional, default is true. Add or remove links. Defaults to true. */ function automatic_feed_links( $add = true ) { _deprecated_function( __FUNCTION__, '3.0', "add_theme_support( 'automatic-feed-links' )" ); diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index c58ee26d0f..0929004e16 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -2057,8 +2057,8 @@ function get_next_posts_page_link($max_page = 0) { * * @since 0.71 * - * @param int $max_page Optional. Max pages. - * @param boolean $echo Optional. Echo or return; + * @param int $max_page Optional. Max pages. + * @param bool $echo Optional. Echo or return; * @return string|void The link URL for next posts page if `$echo = false`. */ function next_posts( $max_page = 0, $echo = true ) { @@ -2151,7 +2151,7 @@ function get_previous_posts_page_link() { * * @since 0.71 * - * @param boolean $echo Optional. Echo or return; + * @param bool $echo Optional. Echo or return; * @return string|void The previous posts page link if `$echo = false`. */ function previous_posts( $echo = true ) { diff --git a/wp-includes/plugin.php b/wp-includes/plugin.php index e2d2a0b50d..0042c5bb60 100644 --- a/wp-includes/plugin.php +++ b/wp-includes/plugin.php @@ -615,7 +615,7 @@ function has_action($tag, $function_to_check = false) { * @param string $tag The action hook to which the function to be removed is hooked. * @param callback $function_to_remove The name of the function which should be removed. * @param int $priority Optional. The priority of the function. Default 10. - * @return boolean Whether the function is removed. + * @return bool Whether the function is removed. */ function remove_action( $tag, $function_to_remove, $priority = 10 ) { return remove_filter( $tag, $function_to_remove, $priority ); diff --git a/wp-includes/theme.php b/wp-includes/theme.php index b5cd8c4f6e..65c7d3001f 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -1159,7 +1159,7 @@ function get_random_header_image() { * @since 3.2.0 * * @param string $type The random pool to use. any|default|uploaded - * @return boolean + * @return bool */ function is_random_header_image( $type = 'any' ) { $header_image_mod = get_theme_mod( 'header_image', get_theme_support( 'custom-header', 'default-image' ) ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 6898609047..c17b214847 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.3-alpha-32963'; +$wp_version = '4.3-alpha-32964'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index 3e06848cfe..83cdafa641 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -176,7 +176,7 @@ class wpdb { * @since 4.2.0 * @access private * @see wpdb::check_safe_collation() - * @var boolean + * @var bool */ private $checking_collation = false; diff --git a/wp-signup.php b/wp-signup.php index 7cef5447ff..3373f8ecd8 100644 --- a/wp-signup.php +++ b/wp-signup.php @@ -299,8 +299,8 @@ function signup_another_blog( $blogname = '', $blog_title = '', $errors = '' ) { * * @since MU * - * @return null|boolean True if blog signup was validated, false if error. - * The function halts all execution if the user is not logged in. + * @return null|bool True if blog signup was validated, false if error. + * The function halts all execution if the user is not logged in. */ function validate_another_blog_signup() { global $wpdb, $blogname, $blog_title, $errors, $domain, $path;