Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions src/Illuminate/Contracts/Cache/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ interface Repository extends CacheInterface
/**
* Retrieve an item from the cache and delete it.
*
* @template TCached of mixed
*
* @param string $key
* @param mixed $default
* @return mixed
* @param null|TCached $default
* @return null|TCached
*/
public function pull($key, $default = null);

Expand Down Expand Up @@ -66,28 +68,34 @@ public function forever($key, $value);
/**
* Get an item from the cache, or execute the given Closure and store the result.
*
* @template TCached of mixed
*
* @param string $key
* @param \DateTimeInterface|\DateInterval|int|null $ttl
* @param \Closure $callback
* @return mixed
* @param \Closure(): TCached $callback
* @return TCached
*/
public function remember($key, $ttl, Closure $callback);

/**
* Get an item from the cache, or execute the given Closure and store the result forever.
*
* @template TCached of mixed
*
* @param string $key
* @param \Closure $callback
* @return mixed
* @param \Closure(): TCached $callback
* @return TCached
*/
public function sear($key, Closure $callback);

/**
* Get an item from the cache, or execute the given Closure and store the result forever.
*
* @template TCached of mixed
*
* @param string $key
* @param \Closure $callback
* @return mixed
* @param \Closure(): TCached $callback
* @return TCached
*/
public function rememberForever($key, Closure $callback);

Expand Down
12 changes: 7 additions & 5 deletions src/Illuminate/Support/Facades/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
namespace Illuminate\Support\Facades;

/**
* @template TCached of mixed
*
* @method static \Illuminate\Cache\TaggedCache tags(array|mixed $names)
* @method static \Illuminate\Contracts\Cache\Lock lock(string $name, int $seconds = 0, mixed $owner = null)
* @method static \Illuminate\Contracts\Cache\Lock restoreLock(string $name, string $owner)
Expand All @@ -17,11 +19,11 @@
* @method static bool put(string $key, $value, \DateTimeInterface|\DateInterval|int $ttl = null)
* @method static int|bool decrement(string $key, $value = 1)
* @method static int|bool increment(string $key, $value = 1)
* @method static mixed get(string $key, mixed $default = null)
* @method static mixed pull(string $key, mixed $default = null)
* @method static mixed remember(string $key, \DateTimeInterface|\DateInterval|int $ttl, \Closure $callback)
* @method static mixed rememberForever(string $key, \Closure $callback)
* @method static mixed sear(string $key, \Closure $callback)
* @method static null|TCached get(string $key, TCached $default = null)
* @method static null|TCached pull(string $key, TCached $default = null)
* @method static TCached remember(string $key, \DateTimeInterface|\DateInterval|int $ttl, \Closure(): TCached $callback)
* @method static TCached rememberForever(string $key, \Closure(): TCached $callback)
* @method static TCached sear(string $key, \Closure(): TCached $callback)
*
* @see \Illuminate\Cache\CacheManager
* @see \Illuminate\Cache\Repository
Expand Down