WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/11/2020 06:30:58 PM (13 months ago)
Author:
SergeyBiryukov
Message:

Docs: In various @return tags, list the expected type first, instead of false.

Follow-up to [46696].

See #48303.

File:
1 edited

Legend:

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

    r45161 r47060  
    2323 * @param int        $expire Optional. When the cache data should expire, in seconds.
    2424 *                           Default 0 (no expiration).
    25  * @return bool False if cache key and group already exist, true on success.
     25 * @return bool True on success, false if cache key and group already exist.
    2626 */
    2727function wp_cache_add( $key, $data, $group = '', $expire = 0 ) {
     
    5959 * @param int        $offset Optional. The amount by which to decrement the item's value. Default 1.
    6060 * @param string     $group  Optional. The group the key is in. Default empty.
    61  * @return false|int False on failure, the item's new value on success.
     61 * @return int|false The item's new value on success, false on failure.
    6262 */
    6363function wp_cache_decr( $key, $offset = 1, $group = '' ) {
     
    9393 * @global WP_Object_Cache $wp_object_cache Object cache global instance.
    9494 *
    95  * @return bool False on failure, true on success
     95 * @return bool True on success, false on failure.
    9696 */
    9797function wp_cache_flush() {
     
    135135 * @param int        $offset Optional. The amount by which to increment the item's value. Default 1.
    136136 * @param string     $group  Optional. The group the key is in. Default empty.
    137  * @return false|int False on failure, the item's new value on success.
     137 * @return int|false The item's new value on success, false on failure.
    138138 */
    139139function wp_cache_incr( $key, $offset = 1, $group = '' ) {
     
    192192 * @param int        $expire Optional. When to expire the cache contents, in seconds.
    193193 *                           Default 0 (no expiration).
    194  * @return bool False on failure, true on success
     194 * @return bool True on success, false on failure.
    195195 */
    196196function wp_cache_set( $key, $data, $group = '', $expire = 0 ) {
     
    397397     * @param string     $group  Optional. Where to group the cache contents. Default 'default'.
    398398     * @param int        $expire Optional. When to expire the cache contents. Default 0 (no expiration).
    399      * @return bool False if cache key and group already exist, true on success
     399     * @return bool True on success, false if cache key and group already exist.
    400400     */
    401401    public function add( $key, $data, $group = 'default', $expire = 0 ) {
     
    442442     * @param int        $offset Optional. The amount by which to decrement the item's value. Default 1.
    443443     * @param string     $group  Optional. The group the key is in. Default 'default'.
    444      * @return false|int False on failure, the item's new value on success.
     444     * @return int|false The item's new value on success, false on failure.
    445445     */
    446446    public function decr( $key, $offset = 1, $group = 'default' ) {
     
    531531     * @param bool       $found  Optional. Whether the key was found in the cache (passed by reference).
    532532     *                           Disambiguates a return of false, a storable value. Default null.
    533      * @return false|mixed False on failure to retrieve contents or the cache contents on success.
     533     * @return mixed|false The cache contents on success, false on failure to retrieve contents.
    534534     */
    535535    public function get( $key, $group = 'default', $force = false, &$found = null ) {
     
    565565     * @param int        $offset Optional. The amount by which to increment the item's value. Default 1.
    566566     * @param string     $group  Optional. The group the key is in. Default 'default'.
    567      * @return false|int False on failure, the item's new value on success.
     567     * @return int|false The item's new value on success, false on failure.
    568568     */
    569569    public function incr( $key, $offset = 1, $group = 'default' ) {
Note: See TracChangeset for help on using the changeset viewer.