Skip to content

Commit 679ccc3

Browse files
committed
Docs: Promote many bool types to true or false where only that value is used.
See #51800 git-svn-id: https://develop.svn.wordpress.org/trunk@49927 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 374b41e commit 679ccc3

59 files changed

Lines changed: 169 additions & 169 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/wp-admin/includes/class-wp-community-events.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class WP_Community_Events {
2929
*
3030
* @since 4.8.0
3131
*
32-
* @var bool|array
32+
* @var false|array
3333
*/
3434
protected $user_location = false;
3535

@@ -306,7 +306,7 @@ protected function coordinates_match( $a, $b ) {
306306
* @since 4.8.0
307307
*
308308
* @param array $location Should contain 'latitude' and 'longitude' indexes.
309-
* @return bool|string false on failure, or a string on success.
309+
* @return false|string false on failure, or a string on success.
310310
*/
311311
protected function get_events_transient_key( $location ) {
312312
$key = false;
@@ -325,8 +325,8 @@ protected function get_events_transient_key( $location ) {
325325
*
326326
* @since 4.8.0
327327
*
328-
* @param array $events Response body from the API request.
329-
* @param int|bool $expiration Optional. Amount of time to cache the events. Defaults to false.
328+
* @param array $events Response body from the API request.
329+
* @param int|false $expiration Optional. Amount of time to cache the events. Defaults to false.
330330
* @return bool true if events were cached; false if not.
331331
*/
332332
protected function cache_events( $events, $expiration = false ) {

src/wp-admin/includes/class-wp-site-health-auto-updates.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function test_filters_automatic_updater_disabled() {
128128
*
129129
* @since 5.3.0
130130
*
131-
* @return array|bool The test results. False if auto-updates are enabled.
131+
* @return array|false The test results. False if auto-updates are enabled.
132132
*/
133133
public function test_wp_automatic_updates_disabled() {
134134
if ( ! class_exists( 'WP_Automatic_Updater' ) ) {
@@ -152,7 +152,7 @@ public function test_wp_automatic_updates_disabled() {
152152
*
153153
* @since 5.2.0
154154
*
155-
* @return array|bool The test results. False if the auto-updates failed.
155+
* @return array|false The test results. False if the auto-updates failed.
156156
*/
157157
function test_if_failed_update() {
158158
$failed = get_site_option( 'auto_core_update_failed' );
@@ -302,7 +302,7 @@ function test_check_wp_filesystem_method() {
302302
*
303303
* @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
304304
*
305-
* @return array|bool The test results. False if they're not writeable.
305+
* @return array|false The test results. False if they're not writeable.
306306
*/
307307
function test_all_files_writable() {
308308
global $wp_filesystem;
@@ -387,7 +387,7 @@ function test_all_files_writable() {
387387
*
388388
* @since 5.2.0
389389
*
390-
* @return array|bool The test results. False if it isn't a development version.
390+
* @return array|false The test results. False if it isn't a development version.
391391
*/
392392
function test_accepts_dev_updates() {
393393
require ABSPATH . WPINC . '/version.php'; // $wp_version; // x.y.z

src/wp-admin/includes/dashboard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1680,7 +1680,7 @@ function dashboard_browser_nag_class( $classes ) {
16801680
*
16811681
* @since 3.2.0
16821682
*
1683-
* @return array|bool Array of browser data on success, false on failure.
1683+
* @return array|false Array of browser data on success, false on failure.
16841684
*/
16851685
function wp_check_browser_version() {
16861686
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {

src/wp-admin/includes/deprecated.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ function get_author_user_ids() {
247247
* @global wpdb $wpdb WordPress database abstraction object.
248248
*
249249
* @param int $user_id User ID.
250-
* @return array|bool List of editable authors. False if no editable users.
250+
* @return array|false List of editable authors. False if no editable users.
251251
*/
252252
function get_editable_authors( $user_id ) {
253253
_deprecated_function( __FUNCTION__, '3.1.0', 'get_users()' );

src/wp-admin/includes/file.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ function get_home_path() {
130130
* @param string $folder Optional. Full path to folder. Default empty.
131131
* @param int $levels Optional. Levels of folders to follow, Default 100 (PHP Loop limit).
132132
* @param string[] $exclusions Optional. List of folders and files to skip.
133-
* @return bool|string[] False on failure, else array of files.
133+
* @return false|string[] False on failure, else array of files.
134134
*/
135135
function list_files( $folder = '', $levels = 100, $exclusions = array() ) {
136136
if ( empty( $folder ) ) {
@@ -998,11 +998,11 @@ function wp_handle_upload_error( &$file, $message ) {
998998
*
999999
* @see _wp_handle_upload()
10001000
*
1001-
* @param array $file Reference to a single element of `$_FILES`.
1002-
* Call the function once for each uploaded file.
1003-
* @param array|bool $overrides Optional. An associative array of names => values
1004-
* to override default variables. Default false.
1005-
* @param string $time Optional. Time formatted in 'yyyy/mm'. Default null.
1001+
* @param array $file Reference to a single element of `$_FILES`.
1002+
* Call the function once for each uploaded file.
1003+
* @param array|false $overrides Optional. An associative array of names => values
1004+
* to override default variables. Default false.
1005+
* @param string $time Optional. Time formatted in 'yyyy/mm'. Default null.
10061006
* @return array On success, returns an associative array of file attributes.
10071007
* On failure, returns `$overrides['upload_error_handler']( &$file, $message )`
10081008
* or `array( 'error' => $message )`.
@@ -1029,11 +1029,11 @@ function wp_handle_upload( &$file, $overrides = false, $time = null ) {
10291029
*
10301030
* @see _wp_handle_upload()
10311031
*
1032-
* @param array $file Reference to a single element of `$_FILES`.
1033-
* Call the function once for each uploaded file.
1034-
* @param array|bool $overrides Optional. An associative array of names => values
1035-
* to override default variables. Default false.
1036-
* @param string $time Optional. Time formatted in 'yyyy/mm'. Default null.
1032+
* @param array $file Reference to a single element of `$_FILES`.
1033+
* Call the function once for each uploaded file.
1034+
* @param array|false $overrides Optional. An associative array of names => values
1035+
* to override default variables. Default false.
1036+
* @param string $time Optional. Time formatted in 'yyyy/mm'. Default null.
10371037
* @return array On success, returns an associative array of file attributes.
10381038
* On failure, returns `$overrides['upload_error_handler']( &$file, $message )`
10391039
* or `array( 'error' => $message )`.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
*
1212
* @since 2.9.0
1313
*
14-
* @param int $post_id Attachment post ID.
15-
* @param bool|object $msg Optional. Message to display for image editor updates or errors.
16-
* Default false.
14+
* @param int $post_id Attachment post ID.
15+
* @param false|object $msg Optional. Message to display for image editor updates or errors.
16+
* Default false.
1717
*/
1818
function wp_image_editor( $post_id, $msg = false ) {
1919
$nonce = wp_create_nonce( "image_editor-$post_id" );

src/wp-admin/includes/image.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ function wp_exif_date2ts( $str ) {
680680
* @since 2.5.0
681681
*
682682
* @param string $file
683-
* @return bool|array False on failure. Image metadata array on success.
683+
* @return false|array False on failure. Image metadata array on success.
684684
*/
685685
function wp_read_image_metadata( $file ) {
686686
if ( ! file_exists( $file ) ) {
@@ -1027,7 +1027,7 @@ function _load_image_to_edit_path( $attachment_id, $size = 'full' ) {
10271027
*
10281028
* @since 2.9.0
10291029
*
1030-
* @param string|bool $filepath File path or URL to current image, or false.
1030+
* @param string|false $filepath File path or URL to current image, or false.
10311031
* @param int $attachment_id Attachment ID.
10321032
* @param string|int[] $size Requested image size. Can be any registered image size name, or
10331033
* an array of width and height values in pixels (in that order).

src/wp-admin/includes/list-table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*
1818
* @param string $class The type of the list table, which is the class name.
1919
* @param array $args Optional. Arguments to pass to the class. Accepts 'screen'.
20-
* @return WP_List_Table|bool List table object on success, false if the class does not exist.
20+
* @return WP_List_Table|false List table object on success, false if the class does not exist.
2121
*/
2222
function _get_list_table( $class, $args = array() ) {
2323
$core_classes = array(

src/wp-admin/includes/media.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3526,7 +3526,7 @@ function wp_add_id3_tag_data( &$metadata, $data ) {
35263526
* @since 3.6.0
35273527
*
35283528
* @param string $file Path to file.
3529-
* @return array|bool Returns array of metadata, if found.
3529+
* @return array|false Returns array of metadata, if found.
35303530
*/
35313531
function wp_read_video_metadata( $file ) {
35323532
if ( ! file_exists( $file ) ) {
@@ -3637,7 +3637,7 @@ function wp_read_video_metadata( $file ) {
36373637
* @since 3.6.0
36383638
*
36393639
* @param string $file Path to file.
3640-
* @return array|bool Returns array of metadata, if found.
3640+
* @return array|false Returns array of metadata, if found.
36413641
*/
36423642
function wp_read_audio_metadata( $file ) {
36433643
if ( ! file_exists( $file ) ) {
@@ -3706,8 +3706,8 @@ function wp_read_audio_metadata( $file ) {
37063706
* @link https://github.com/JamesHeinrich/getID3/blob/master/structure.txt
37073707
*
37083708
* @param array $metadata The metadata returned by getID3::analyze().
3709-
* @return int|bool A UNIX timestamp for the media's creation date if available
3710-
* or a boolean FALSE if a timestamp could not be determined.
3709+
* @return int|false A UNIX timestamp for the media's creation date if available
3710+
* or a boolean FALSE if a timestamp could not be determined.
37113711
*/
37123712
function wp_get_media_creation_timestamp( $metadata ) {
37133713
$creation_date = false;

src/wp-admin/includes/ms.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ function upload_space_setting( $id ) {
311311
* @since 3.0.0
312312
*
313313
* @param int $id The user ID.
314-
* @return bool|int The ID of the refreshed user or false if the user does not exist.
314+
* @return false|int The ID of the refreshed user or false if the user does not exist.
315315
*/
316316
function refresh_user_details( $id ) {
317317
$id = (int) $id;

0 commit comments

Comments
 (0)