Make WordPress Core

Changeset 52703


Ignore:
Timestamp:
02/11/2022 05:42:51 PM (2 years ago)
Author:
SergeyBiryukov
Message:

Docs: Update DocBlocks for some object cache functions per the documentation standards.

Follow-up to [47060], [47938], [47944], [52700].

See #54729, #54574.

Location:
trunk/src/wp-includes
Files:
3 edited

Legend:

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

    r52700 r52703  
    3939if ( ! function_exists( 'wp_cache_delete_multiple' ) ) :
    4040    /**
    41      * Delete multiple values from the cache in one call.
     41     * Deletes multiple values from the cache in one call.
    4242     *
    4343     * Compat function to mimic wp_cache_delete_multiple().
     
    6666if ( ! function_exists( 'wp_cache_add_multiple' ) ) :
    6767    /**
    68      * Add multiple values to the cache in one call, if the cache keys doesn't already exist.
     68     * Adds multiple values to the cache in one call, if the cache keys don't already exist.
    6969     *
    7070     * Compat function to mimic wp_cache_add_multiple().
     
    7575     * @see wp_cache_add_multiple()
    7676     *
    77      * @param array  $data  Array of key and value to be added.
    78      * @param string $group Optional. Where the cache contents are grouped. Default empty.
    79      * @param int    $expire Optional. When to expire the cache contents, in seconds. Default 0 (no expiration).
     77     * @param array  $data   Array of keys and values to be added.
     78     * @param string $group  Optional. Where the cache contents are grouped. Default empty.
     79     * @param int    $expire Optional. When to expire the cache contents, in seconds.
     80     *                       Default 0 (no expiration).
    8081     * @return array Array of return values.
    8182     */
     
    9394if ( ! function_exists( 'wp_cache_set_multiple' ) ) :
    9495    /**
    95      * Set multiple values to the cache in one call.
     96     * Sets multiple values to the cache in one call.
    9697     *
    9798     * Differs from wp_cache_add_multiple() in that it will always write data.
     
    104105     * @see wp_cache_set_multiple()
    105106     *
    106      * @param array  $data  Array of key and value to be set.
    107      * @param string $group Optional. Where the cache contents are grouped. Default empty.
    108      * @param int    $expire Optional. When to expire the cache contents, in seconds. Default 0 (no expiration).
     107     * @param array  $data   Array of keys and values to be set.
     108     * @param string $group  Optional. Where the cache contents are grouped. Default empty.
     109     * @param int    $expire Optional. When to expire the cache contents, in seconds.
     110     *                       Default 0 (no expiration).
    109111     * @return array Array of return values.
    110112     */
  • trunk/src/wp-includes/cache.php

    r52700 r52703  
    6060 *
    6161 * @param int|string $key    The cache key to decrement.
    62  * @param int        $offset Optional. The amount by which to decrement the item's value. Default 1.
     62 * @param int        $offset Optional. The amount by which to decrement the item's value.
     63 *                           Default 1.
    6364 * @param string     $group  Optional. The group the key is in. Default empty.
    6465 * @return int|false The item's new value on success, false on failure.
     
    146147}
    147148
    148 
    149 /**
    150  * Delete multiple values from the cache in one call.
     149/**
     150 * Deletes multiple values from the cache in one call.
    151151 *
    152152 * @since 6.0.0
     
    157157 * @param array  $keys  Array of keys under which the cache to deleted.
    158158 * @param string $group Optional. Where the cache contents are grouped. Default empty.
    159  * @return array Array of return values organized into groups.
     159 * @return array Array of return values.
    160160 */
    161161function wp_cache_delete_multiple( array $keys, $group = '' ) {
     
    166166
    167167/**
    168  * Add multiple values to the cache in one call.
     168 * Adds multiple values to the cache in one call.
    169169 *
    170170 * @since 6.0.0
     
    173173 * @global WP_Object_Cache $wp_object_cache Object cache global instance.
    174174 *
    175  * @param array  $data  Array of key and value to be set.
    176  * @param string $group Optional. Where the cache contents are grouped. Default empty.
     175 * @param array  $data   Array of keys and values to be set.
     176 * @param string $group  Optional. Where the cache contents are grouped. Default empty.
    177177 * @param int    $expire Optional. When to expire the cache contents, in seconds.
    178  *                           Default 0 (no expiration).
     178 *                       Default 0 (no expiration).
    179179 * @return array Array of return values.
    180180 */
     
    186186
    187187/**
    188  * Set multiple values to the cache in one call.
     188 * Sets multiple values to the cache in one call.
    189189 *
    190190 * @since 6.0.0
     
    193193 * @global WP_Object_Cache $wp_object_cache Object cache global instance.
    194194 *
    195  * @param array  $data  Array of key and value to be set.
    196  * @param string $group Optional. Where the cache contents are grouped. Default empty.
     195 * @param array  $data   Array of keys and values to be set.
     196 * @param string $group  Optional. Where the cache contents are grouped. Default empty.
    197197 * @param int    $expire Optional. When to expire the cache contents, in seconds.
    198  *                           Default 0 (no expiration).
     198 *                       Default 0 (no expiration).
    199199 * @return array Array of return values.
    200200 */
     
    206206
    207207/**
    208  * Increment numeric cache item's value
     208 * Increments numeric cache item's value.
    209209 *
    210210 * @since 3.3.0
     
    214214 *
    215215 * @param int|string $key    The key for the cache contents that should be incremented.
    216  * @param int        $offset Optional. The amount by which to increment the item's value. Default 1.
     216 * @param int        $offset Optional. The amount by which to increment the item's value.
     217 *                           Default 1.
    217218 * @param string     $group  Optional. The group the key is in. Default empty.
    218219 * @return int|false The item's new value on success, false on failure.
     
    249250 * @param int        $expire Optional. When to expire the cache contents, in seconds.
    250251 *                           Default 0 (no expiration).
    251  * @return bool False if original value does not exist, true if contents were replaced
     252 * @return bool True if contents were replaced, false if original value does not exist.
    252253 */
    253254function wp_cache_replace( $key, $data, $group = '', $expire = 0 ) {
     
    336337 * function when preparing the cache for a blog switch. For clearing the cache
    337338 * during unit tests, consider using wp_cache_init(). wp_cache_init() is not
    338  * recommended outside of unit tests as the performance penalty for using it is
    339  * high.
     339 * recommended outside of unit tests as the performance penalty for using it is high.
    340340 *
    341341 * @since 2.6.0
  • trunk/src/wp-includes/class-wp-object-cache.php

    r52700 r52703  
    142142     * @param mixed      $data   The contents to store in the cache.
    143143     * @param string     $group  Optional. Where to group the cache contents. Default 'default'.
    144      * @param int        $expire Optional. When to expire the cache contents. Default 0 (no expiration).
     144     * @param int        $expire Optional. When to expire the cache contents, in seconds.
     145     *                           Default 0 (no expiration).
    145146     * @return bool True on success, false if cache key and group already exist.
    146147     */
     
    186187     *
    187188     * @param int|string $key    The cache key to decrement.
    188      * @param int        $offset Optional. The amount by which to decrement the item's value. Default 1.
     189     * @param int        $offset Optional. The amount by which to decrement the item's value.
     190     *                           Default 1.
    189191     * @param string     $group  Optional. The group the key is in. Default 'default'.
    190192     * @return int|false The item's new value on success, false on failure.
     
    228230     * @param string     $group      Optional. Where the cache contents are grouped. Default 'default'.
    229231     * @param bool       $deprecated Optional. Unused. Default false.
    230      * @return bool False if the contents weren't deleted and true on success.
     232     * @return bool True on success, false if the contents were not deleted.
    231233     */
    232234    public function delete( $key, $group = 'default', $deprecated = false ) {
     
    325327
    326328    /**
    327      * Delete multiple values from the cache in one call.
     329     * Deletes multiple values from the cache in one call.
    328330     *
    329331     * @since 6.0.0
     
    344346
    345347    /**
    346      * Add multiple values to the cache in one call.
     348     * Adds multiple values to the cache in one call.
    347349     *
    348350     * @since 6.0.0
    349351     *
    350      * @param array  $data   Array of key and value to be added.
     352     * @param array  $data   Array of keys and values to be added.
    351353     * @param string $group  Optional. Where the cache contents are grouped. Default empty.
    352      * @param int    $expire Optional. When to expire the cache contents, in seconds. Default 0 (no expiration).
     354     * @param int    $expire Optional. When to expire the cache contents, in seconds.
     355     *                       Default 0 (no expiration).
    353356     * @return array Array of return values.
    354357     */
     
    364367
    365368    /**
    366      * Set multiple values to the cache in one call.
     369     * Sets multiple values to the cache in one call.
    367370     *
    368371     * @since 6.0.0
     
    370373     * @param array  $data   Array of key and value to be set.
    371374     * @param string $group  Optional. Where the cache contents are grouped. Default empty.
    372      * @param int    $expire Optional. When to expire the cache contents, in seconds. Default 0 (no expiration).
     375     * @param int    $expire Optional. When to expire the cache contents, in seconds.
     376     *                       Default 0 (no expiration).
    373377     * @return array Array of return values.
    374378     */
     
    388392     * @since 3.3.0
    389393     *
    390      * @param int|string $key    The cache key to increment
    391      * @param int        $offset Optional. The amount by which to increment the item's value. Default 1.
     394     * @param int|string $key    The cache key to increment.
     395     * @param int        $offset Optional. The amount by which to increment the item's value.
     396     *                           Default 1.
    392397     * @param string     $group  Optional. The group the key is in. Default 'default'.
    393398     * @return int|false The item's new value on success, false on failure.
     
    431436     * @param mixed      $data   The contents to store in the cache.
    432437     * @param string     $group  Optional. Where to group the cache contents. Default 'default'.
    433      * @param int        $expire Optional. When to expire the cache contents. Default 0 (no expiration).
    434      * @return bool False if not exists, true if contents were replaced.
     438     * @param int        $expire Optional. When to expire the cache contents, in seconds.
     439     *                           Default 0 (no expiration).
     440     * @return bool True if contents were replaced, false if original value does not exist.
    435441     */
    436442    public function replace( $key, $data, $group = 'default', $expire = 0 ) {
     
    487493     * @param mixed      $data   The contents to store in the cache.
    488494     * @param string     $group  Optional. Where to group the cache contents. Default 'default'.
    489      * @param int        $expire Not Used.
     495     * @param int        $expire Optional. Not used.
    490496     * @return true Always returns true.
    491497     */
Note: See TracChangeset for help on using the changeset viewer.