Make WordPress Core

Changeset 52708


Ignore:
Timestamp:
02/11/2022 07:19:57 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve @return tags for wp_cache_*_multiple() functions:

  • wp_cache_add_multiple()
  • wp_cache_set_multiple()
  • wp_cache_get_multiple()
  • wp_cache_delete_multiple()

This aims to provide more details about the returned value types.

Follow-up to [52700], [52702], [52703].

See #54729, #54574.

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

Legend:

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

    r52706 r52708  
    2424     * @param int    $expire Optional. When to expire the cache contents, in seconds.
    2525     *                       Default 0 (no expiration).
    26      * @return array Array of return values.
     26     * @return bool[] Array of return values, grouped by key. Each value is either
     27     *                true on success, or false if cache key and group already exist.
    2728     */
    2829    function wp_cache_add_multiple( array $data, $group = '', $expire = 0 ) {
     
    5455     * @param int    $expire Optional. When to expire the cache contents, in seconds.
    5556     *                       Default 0 (no expiration).
    56      * @return array Array of return values.
     57     * @return bool[] Array of return values, grouped by key. Each value is either
     58     *                true on success, or false on failure.
    5759     */
    5860    function wp_cache_set_multiple( array $data, $group = '', $expire = 0 ) {
     
    8284     * @param bool   $force Optional. Whether to force an update of the local cache
    8385     *                      from the persistent cache. Default false.
    84      * @return array Array of values organized into groups.
     86     * @return array Array of return values, grouped by key. Each value is either
     87     *               the cache contents on success, or false on failure.
    8588     */
    8689    function wp_cache_get_multiple( $keys, $group = '', $force = false ) {
     
    108111     * @param array  $keys  Array of keys under which the cache to deleted.
    109112     * @param string $group Optional. Where the cache contents are grouped. Default empty.
    110      * @return array Array of return values.
     113     * @return bool[] Array of return values, grouped by key. Each value is either
     114     *                true on success, or false if the contents were not deleted.
    111115     */
    112116    function wp_cache_delete_multiple( array $keys, $group = '' ) {
  • trunk/src/wp-includes/cache.php

    r52706 r52708  
    5757 * @param int    $expire Optional. When to expire the cache contents, in seconds.
    5858 *                       Default 0 (no expiration).
    59  * @return array Array of return values.
     59 * @return bool[] Array of return values, grouped by key. Each value is either
     60 *                true on success, or false if cache key and group already exist.
    6061 */
    6162function wp_cache_add_multiple( array $data, $group = '', $expire = 0 ) {
     
    123124 * @param int    $expire Optional. When to expire the cache contents, in seconds.
    124125 *                       Default 0 (no expiration).
    125  * @return array Array of return values.
     126 * @return bool[] Array of return values, grouped by key. Each value is either
     127 *                true on success, or false on failure.
    126128 */
    127129function wp_cache_set_multiple( array $data, $group = '', $expire = 0 ) {
     
    165167 * @param bool   $force Optional. Whether to force an update of the local cache
    166168 *                      from the persistent cache. Default false.
    167  * @return array Array of values organized into groups.
     169 * @return array Array of return values, grouped by key. Each value is either
     170 *               the cache contents on success, or false on failure.
    168171 */
    169172function wp_cache_get_multiple( $keys, $group = '', $force = false ) {
     
    201204 * @param array  $keys  Array of keys under which the cache to deleted.
    202205 * @param string $group Optional. Where the cache contents are grouped. Default empty.
    203  * @return array Array of return values.
     206 * @return bool[] Array of return values, grouped by key. Each value is either
     207 *                true on success, or false if the contents were not deleted.
    204208 */
    205209function wp_cache_delete_multiple( array $keys, $group = '' ) {
  • trunk/src/wp-includes/class-wp-object-cache.php

    r52706 r52708  
    189189     * @param int    $expire Optional. When to expire the cache contents, in seconds.
    190190     *                       Default 0 (no expiration).
    191      * @return array Array of return values.
     191     * @return bool[] Array of return values, grouped by key. Each value is either
     192     *                true on success, or false if cache key and group already exist.
    192193     */
    193194    public function add_multiple( array $data, $group = '', $expire = 0 ) {
     
    278279     * @param int    $expire Optional. When to expire the cache contents, in seconds.
    279280     *                       Default 0 (no expiration).
    280      * @return array Array of return values.
     281     * @return bool[] Array of return values, grouped by key. Each value is always true.
    281282     */
    282283    public function set_multiple( array $data, $group = '', $expire = 0 ) {
     
    342343     * @param bool   $force Optional. Whether to force an update of the local cache
    343344     *                      from the persistent cache. Default false.
    344      * @return array Array of values organized into groups.
     345     * @return array Array of return values, grouped by key. Each value is either
     346     *               the cache contents on success, or false on failure.
    345347     */
    346348    public function get_multiple( $keys, $group = 'default', $force = false ) {
     
    390392     * @param array  $keys  Array of keys to be deleted.
    391393     * @param string $group Optional. Where the cache contents are grouped. Default empty.
    392      * @return array Array of return values.
     394     * @return bool[] Array of return values, grouped by key. Each value is either
     395     *                true on success, or false if the contents were not deleted.
    393396     */
    394397    public function delete_multiple( array $keys, $group = '' ) {
Note: See TracChangeset for help on using the changeset viewer.