Skip to content

Commit f162be6

Browse files
committed
For doc block types, favor bool over the few remaining booleans
See #32444. git-svn-id: https://develop.svn.wordpress.org/trunk@32964 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 2a5278e commit f162be6

20 files changed

Lines changed: 79 additions & 79 deletions

src/wp-admin/includes/export.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ function wxr_post_taxonomy() {
319319
*
320320
* @param bool $return_me
321321
* @param string $meta_key
322-
* @return boolean
322+
* @return bool
323323
*/
324324
function wxr_filter_postmeta( $return_me, $meta_key ) {
325325
if ( '_edit_lock' == $meta_key )

src/wp-admin/includes/file.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ function copy_dir($from, $to, $skip_list = array() ) {
837837
* the `WP_Filesystem_*()` classes. Default false.
838838
* @param string|false $context Optional. Context for get_filesystem_method(). Default false.
839839
* @param bool $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable. Default false.
840-
* @return null|boolean false on failure, true on success.
840+
* @return null|bool false on failure, true on success.
841841
*/
842842
function WP_Filesystem( $args = false, $context = false, $allow_relaxed_file_ownership = false ) {
843843
global $wp_filesystem;
@@ -996,13 +996,13 @@ function get_filesystem_method( $args = array(), $context = false, $allow_relaxe
996996
*
997997
* @todo Properly mark optional arguments as such
998998
*
999-
* @param string $form_post the URL to post the form to
1000-
* @param string $type the chosen Filesystem method in use
1001-
* @param boolean $error if the current request has failed to connect
1002-
* @param string $context The directory which is needed access to, The write-test will be performed on this directory by get_filesystem_method()
1003-
* @param array $extra_fields Extra POST fields which should be checked for to be included in the post.
1004-
* @param bool $allow_relaxed_file_ownership Whether to allow Group/World writable.
1005-
* @return boolean False on failure. True on success.
999+
* @param string $form_post the URL to post the form to
1000+
* @param string $type the chosen Filesystem method in use
1001+
* @param bool $error if the current request has failed to connect
1002+
* @param string $context The directory which is needed access to, The write-test will be performed on this directory by get_filesystem_method()
1003+
* @param array $extra_fields Extra POST fields which should be checked for to be included in the post.
1004+
* @param bool $allow_relaxed_file_ownership Whether to allow Group/World writable.
1005+
* @return bool False on failure. True on success.
10061006
*/
10071007
function request_filesystem_credentials($form_post, $type = '', $error = false, $context = false, $extra_fields = null, $allow_relaxed_file_ownership = false ) {
10081008

src/wp-admin/includes/image-edit.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ function wp_image_editor($post_id, $msg = false) {
208208
* @param WP_Image_Editor $image
209209
* @param string $mime_type
210210
* @param int $post_id
211-
* @return boolean
211+
* @return bool
212212
*/
213213
function wp_stream_image( $image, $mime_type, $post_id ) {
214214
if ( $image instanceof WP_Image_Editor ) {
@@ -264,7 +264,7 @@ function wp_stream_image( $image, $mime_type, $post_id ) {
264264
* @param WP_Image_Editor $image
265265
* @param string $mime_type
266266
* @param int $post_id
267-
* @return boolean
267+
* @return bool
268268
*/
269269
function wp_save_image_file( $filename, $image, $mime_type, $post_id ) {
270270
if ( $image instanceof WP_Image_Editor ) {
@@ -552,7 +552,7 @@ function image_edit_apply_changes( $image, $changes ) {
552552
* in $_REQUEST['history']
553553
*
554554
* @param int $post_id
555-
* @return boolean
555+
* @return bool
556556
*/
557557
function stream_preview_image( $post_id ) {
558558
$post = get_post( $post_id );

src/wp-admin/includes/media.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,7 +1493,7 @@ function get_media_item( $attachment_id, $args = null ) {
14931493
}
14941494
if ( 'image' == $type && $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) )
14951495
&& post_type_supports( get_post_type( $calling_post_id ), 'thumbnail' ) && get_post_thumbnail_id( $calling_post_id ) != $attachment_id ) {
1496-
1496+
14971497
$calling_post = get_post( $calling_post_id );
14981498
$calling_post_type_object = get_post_type_object( $calling_post->post_type );
14991499

@@ -1743,11 +1743,11 @@ function media_upload_header() {
17431743

17441744
$post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
17451745

1746-
if ( ! empty( $post_id ) ) {
1747-
$post_type = get_post_type( $post_id );
1746+
if ( ! empty( $post_id ) ) {
1747+
$post_type = get_post_type( $post_id );
17481748
} else {
1749-
$post_type = '';
1750-
}
1749+
$post_type = '';
1750+
}
17511751

17521752
echo '<script type="text/javascript">post_id = ' . $post_id . ';post_type = ' . $post_type . ';</script>';
17531753
if ( empty( $_GET['chromeless'] ) ) {
@@ -3024,7 +3024,7 @@ function wp_read_video_metadata( $file ) {
30243024
* @since 3.6.0
30253025
*
30263026
* @param string $file Path to file.
3027-
* @return array|boolean Returns array of metadata, if found.
3027+
* @return array|bool Returns array of metadata, if found.
30283028
*/
30293029
function wp_read_audio_metadata( $file ) {
30303030
if ( ! file_exists( $file ) )

src/wp-admin/includes/template.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1482,9 +1482,9 @@ function get_settings_errors( $setting = '', $sanitize = false ) {
14821482
*
14831483
* @since 3.0.0
14841484
*
1485-
* @param string $setting Optional slug title of a specific setting who's errors you want.
1486-
* @param boolean $sanitize Whether to re-sanitize the setting value before returning errors.
1487-
* @param boolean $hide_on_update If set to true errors will not be shown if the settings page has already been submitted.
1485+
* @param string $setting Optional slug title of a specific setting who's errors you want.
1486+
* @param bool $sanitize Whether to re-sanitize the setting value before returning errors.
1487+
* @param bool $hide_on_update If set to true errors will not be shown if the settings page has already been submitted.
14881488
*/
14891489
function settings_errors( $setting = '', $sanitize = false, $hide_on_update = false ) {
14901490

src/wp-includes/class-IXR.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ function getXml()
152152
* Checks whether or not the supplied array is a struct or not
153153
*
154154
* @param array $array
155-
* @return boolean
155+
* @return bool
156156
*/
157157
function isStruct($array)
158158
{

src/wp-includes/class-http.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,7 +1255,7 @@ public static function verify_ssl_certificate( $stream, $host ) {
12551255
* @since 2.7.0
12561256
* @since 3.7.0 Combined with the fsockopen transport and switched to stream_socket_client().
12571257
*
1258-
* @return boolean False means this class can not be used, true means it can.
1258+
* @return bool False means this class can not be used, true means it can.
12591259
*/
12601260
public static function test( $args = array() ) {
12611261
if ( ! function_exists( 'stream_socket_client' ) )
@@ -1634,7 +1634,7 @@ private function stream_body( $handle, $data ) {
16341634
* @static
16351635
* @since 2.7.0
16361636
*
1637-
* @return boolean False means this class can not be used, true means it can.
1637+
* @return bool False means this class can not be used, true means it can.
16381638
*/
16391639
public static function test( $args = array() ) {
16401640
if ( ! function_exists( 'curl_init' ) || ! function_exists( 'curl_exec' ) )
@@ -2009,7 +2009,7 @@ public function __construct( $data, $requested_url = '' ) {
20092009
* @since 2.8.0
20102010
*
20112011
* @param string $url URL you intend to send this cookie to
2012-
* @return boolean true if allowed, false otherwise.
2012+
* @return bool true if allowed, false otherwise.
20132013
*/
20142014
public function test( $url ) {
20152015
if ( is_null( $this->name ) )

src/wp-includes/class-wp-customize-manager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ final class WP_Customize_Manager {
3838
/**
3939
* Whether this is a Customizer pageload.
4040
*
41-
* @var boolean
41+
* @var bool
4242
*/
4343
protected $previewing = false;
4444

src/wp-includes/class-wp-customize-widgets.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1431,7 +1431,7 @@ public function wp_ajax_update_widget() {
14311431
* @access protected
14321432
*
14331433
* @param string $option_name Option name.
1434-
* @return boolean Whether the option capture is ignored.
1434+
* @return bool Whether the option capture is ignored.
14351435
*/
14361436
protected function is_option_capture_ignored( $option_name ) {
14371437
return ( 0 === strpos( $option_name, '_transient_' ) );

src/wp-includes/class-wp-image-editor-gd.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public static function supports_mime_type( $mime_type ) {
8787
* @since 3.5.0
8888
* @access protected
8989
*
90-
* @return boolean|WP_Error True if loaded successfully; WP_Error on failure.
90+
* @return bool|WP_Error True if loaded successfully; WP_Error on failure.
9191
*/
9292
public function load() {
9393
if ( $this->image )
@@ -160,7 +160,7 @@ protected function update_size( $width = false, $height = false ) {
160160
*
161161
* @param int|null $max_w Image width.
162162
* @param int|null $max_h Image height.
163-
* @param boolean $crop
163+
* @param bool $crop
164164
* @return true|WP_Error
165165
*/
166166
public function resize( $max_w, $max_h, $crop = false ) {
@@ -272,14 +272,14 @@ public function multi_resize( $sizes ) {
272272
* @since 3.5.0
273273
* @access public
274274
*
275-
* @param int $src_x The start x position to crop from.
276-
* @param int $src_y The start y position to crop from.
277-
* @param int $src_w The width to crop.
278-
* @param int $src_h The height to crop.
279-
* @param int $dst_w Optional. The destination width.
280-
* @param int $dst_h Optional. The destination height.
281-
* @param boolean $src_abs Optional. If the source crop points are absolute.
282-
* @return boolean|WP_Error
275+
* @param int $src_x The start x position to crop from.
276+
* @param int $src_y The start y position to crop from.
277+
* @param int $src_w The width to crop.
278+
* @param int $src_h The height to crop.
279+
* @param int $dst_w Optional. The destination width.
280+
* @param int $dst_h Optional. The destination height.
281+
* @param bool $src_abs Optional. If the source crop points are absolute.
282+
* @return bool|WP_Error
283283
*/
284284
public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false ) {
285285
// If destination width/height isn't specified, use same as
@@ -344,8 +344,8 @@ public function rotate( $angle ) {
344344
* @since 3.5.0
345345
* @access public
346346
*
347-
* @param boolean $horz Flip along Horizontal Axis
348-
* @param boolean $vert Flip along Vertical Axis
347+
* @param bool $horz Flip along Horizontal Axis
348+
* @param bool $vert Flip along Vertical Axis
349349
* @returns true|WP_Error
350350
*/
351351
public function flip( $horz, $vert ) {
@@ -476,7 +476,7 @@ public function stream( $mime_type = null ) {
476476
* @param string|stream $filename
477477
* @param callable $function
478478
* @param array $arguments
479-
* @return boolean
479+
* @return bool
480480
*/
481481
protected function make_image( $filename, $function, $arguments ) {
482482
if ( wp_is_stream( $filename ) )

0 commit comments

Comments
 (0)