From 0c4958bdbcc29beed02a37e5a6d06defd7927643 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 27 Sep 2020 08:34:51 +0000 Subject: [PATCH] Docs: Add missing `@return` tags for some `WP_Automatic_Updater` methods: * `::is_vcs_checkout()` * `::should_update()` * `::send_core_update_notification_email()` Props ankitmaru, mukesh27. Fixes #51385. git-svn-id: https://develop.svn.wordpress.org/trunk@49061 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-automatic-updater.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/includes/class-wp-automatic-updater.php b/src/wp-admin/includes/class-wp-automatic-updater.php index 9cf0a04ac1..f55247c7e6 100644 --- a/src/wp-admin/includes/class-wp-automatic-updater.php +++ b/src/wp-admin/includes/class-wp-automatic-updater.php @@ -62,7 +62,7 @@ class WP_Automatic_Updater { * filesystem to the top of the drive, erring on the side of detecting a VCS * checkout somewhere. * - * ABSPATH is always checked in addition to whatever $context is (which may be the + * ABSPATH is always checked in addition to whatever `$context` is (which may be the * wp-content directory, for example). The underlying assumption is that if you are * using version control *anywhere*, then you should be making decisions for * how things get updated. @@ -70,6 +70,8 @@ class WP_Automatic_Updater { * @since 3.7.0 * * @param string $context The filesystem path to check, in addition to ABSPATH. + * @return bool True if a VCS checkout was discovered at `$context` or ABSPATH, + * or anywhere higher. False otherwise. */ public function is_vcs_checkout( $context ) { $context_dirs = array( untrailingslashit( $context ) ); @@ -112,7 +114,7 @@ class WP_Automatic_Updater { * * @since 3.7.0 * - * @param bool $checkout Whether a VCS checkout was discovered at $context + * @param bool $checkout Whether a VCS checkout was discovered at `$context` * or ABSPATH, or anywhere higher. * @param string $context The filesystem context (a path) against which * filesystem status should be checked. @@ -132,6 +134,7 @@ class WP_Automatic_Updater { * @param object $item The update offer. * @param string $context The filesystem context (a path) against which filesystem * access and status should be checked. + * @return bool True if the item should be updated, false otherwise. */ public function should_update( $type, $item, $context ) { // Used to see if WP_Filesystem is set up to allow unattended updates. @@ -242,6 +245,8 @@ class WP_Automatic_Updater { * @since 3.7.0 * * @param object $item The update offer. + * @return bool True if the site administrator is notified of a core update, + * false otherwise. */ protected function send_core_update_notification_email( $item ) { $notified = get_site_option( 'auto_core_update_notified' );