Make WordPress Core

Changeset 32528


Ignore:
Timestamp:
05/21/2015 08:21:22 PM (9 years ago)
Author:
wonderboymusic
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/cache.php

    r32116 r32528  
    3838 * @since 2.0.0
    3939 *
    40  * @return bool Always returns True
     40 * @return true Always returns True
    4141 */
    4242function wp_cache_close() {
     
    106106 * @param bool &$found Whether key was found in the cache. Disambiguates a return of false, a storable value.
    107107 * @return bool|mixed False on failure to retrieve contents or the cache
    108  *      contents on success
     108 *                    contents on success
    109109 */
    110110function wp_cache_get( $key, $group = '', $force = false, &$found = null ) {
     
    136136 *
    137137 * @since 2.0.0
    138  * @global WP_Object_Cache $wp_object_cache WordPress Object Cache
     138 * @global $wp_object_cache WordPress Object Cache instance
     139 * @uses WP_Object_Cache
    139140 */
    140141function wp_cache_init() {
     
    193194    global $wp_object_cache;
    194195
    195     return $wp_object_cache->switch_to_blog( $blog_id );
     196    $wp_object_cache->switch_to_blog( $blog_id );
    196197}
    197198
     
    206207    global $wp_object_cache;
    207208
    208     return $wp_object_cache->add_global_groups( $groups );
     209    $wp_object_cache->add_global_groups( $groups );
    209210}
    210211
     
    240241    global $wp_object_cache;
    241242
    242     return $wp_object_cache->reset();
     243    $wp_object_cache->reset();
    243244}
    244245
     
    500501     * @param string $group Where the cache contents are grouped
    501502     * @param string $force Whether to force a refetch rather than relying on the local cache (default is false)
    502      * @return bool|mixed False on failure to retrieve contents or the cache
    503      *      contents on success
     503     * @return false|mixed False on failure to retrieve contents or the cache
     504     *                     contents on success
    504505     */
    505506    public function get( $key, $group = 'default', $force = false, &$found = null ) {
     
    617618     * @param string $group Where to group the cache contents
    618619     * @param int $expire Not Used
    619      * @return bool Always returns true
     620     * @return true Always returns true
    620621     */
    621622    public function set( $key, $data, $group = 'default', $expire = 0 ) {
     
    707708     * @since  2.0.8
    708709     *
    709      * @return bool True value. Won't be used by PHP
     710     * @return true True value. Won't be used by PHP
    710711     */
    711712    public function __destruct() {
Note: See TracChangeset for help on using the changeset viewer.