From 63ab0981fce146975a5ae90ec47412a5db1722ed Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 21 May 2015 20:21:22 +0000 Subject: [PATCH] In `cache.php`, clarify some `return` docs. Some `WP_Object_Cache` methods return `void`, so those wrapper functions don't need to return at all. See #32444. git-svn-id: https://develop.svn.wordpress.org/trunk@32528 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/cache.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/wp-includes/cache.php b/src/wp-includes/cache.php index d75c82c669..66c9991e04 100644 --- a/src/wp-includes/cache.php +++ b/src/wp-includes/cache.php @@ -37,7 +37,7 @@ function wp_cache_add( $key, $data, $group = '', $expire = 0 ) { * * @since 2.0.0 * - * @return bool Always returns True + * @return true Always returns True */ function wp_cache_close() { return true; @@ -105,7 +105,7 @@ function wp_cache_flush() { * @param bool $force Whether to force an update of the local cache from the persistent cache (default is false) * @param bool &$found Whether key was found in the cache. Disambiguates a return of false, a storable value. * @return bool|mixed False on failure to retrieve contents or the cache - * contents on success + * contents on success */ function wp_cache_get( $key, $group = '', $force = false, &$found = null ) { global $wp_object_cache; @@ -135,7 +135,8 @@ function wp_cache_incr( $key, $offset = 1, $group = '' ) { * Sets up Object Cache Global and assigns it. * * @since 2.0.0 - * @global WP_Object_Cache $wp_object_cache WordPress Object Cache + * @global $wp_object_cache WordPress Object Cache instance + * @uses WP_Object_Cache */ function wp_cache_init() { $GLOBALS['wp_object_cache'] = new WP_Object_Cache(); @@ -192,7 +193,7 @@ function wp_cache_set( $key, $data, $group = '', $expire = 0 ) { function wp_cache_switch_to_blog( $blog_id ) { global $wp_object_cache; - return $wp_object_cache->switch_to_blog( $blog_id ); + $wp_object_cache->switch_to_blog( $blog_id ); } /** @@ -205,7 +206,7 @@ function wp_cache_switch_to_blog( $blog_id ) { function wp_cache_add_global_groups( $groups ) { global $wp_object_cache; - return $wp_object_cache->add_global_groups( $groups ); + $wp_object_cache->add_global_groups( $groups ); } /** @@ -239,7 +240,7 @@ function wp_cache_reset() { global $wp_object_cache; - return $wp_object_cache->reset(); + $wp_object_cache->reset(); } /** @@ -499,8 +500,8 @@ class WP_Object_Cache { * @param int|string $key What the contents in the cache are called * @param string $group Where the cache contents are grouped * @param string $force Whether to force a refetch rather than relying on the local cache (default is false) - * @return bool|mixed False on failure to retrieve contents or the cache - * contents on success + * @return false|mixed False on failure to retrieve contents or the cache + * contents on success */ public function get( $key, $group = 'default', $force = false, &$found = null ) { if ( empty( $group ) ) @@ -616,7 +617,7 @@ class WP_Object_Cache { * @param mixed $data The contents to store in the cache * @param string $group Where to group the cache contents * @param int $expire Not Used - * @return bool Always returns true + * @return true Always returns true */ public function set( $key, $data, $group = 'default', $expire = 0 ) { if ( empty( $group ) ) @@ -706,7 +707,7 @@ class WP_Object_Cache { * * @since 2.0.8 * - * @return bool True value. Won't be used by PHP + * @return true True value. Won't be used by PHP */ public function __destruct() { return true;