| 1 | <?php |
| 2 | |
| 3 | namespace Illuminate\Support\Facades; |
| 4 | |
| 5 | use Mockery; |
| 6 | |
| 7 | /** |
| 8 | * @method static \Illuminate\Contracts\Cache\Repository store(string|null $name = null) |
| 9 | * @method static \Illuminate\Contracts\Cache\Repository driver(string|null $driver = null) |
| 10 | * @method static \Illuminate\Contracts\Cache\Repository memo(string|null $driver = null) |
| 11 | * @method static \Illuminate\Contracts\Cache\Repository resolve(string $name) |
| 12 | * @method static \Illuminate\Cache\Repository build(array $config) |
| 13 | * @method static \Illuminate\Cache\Repository repository(\Illuminate\Contracts\Cache\Store $store, array $config = []) |
| 14 | * @method static void refreshEventDispatcher() |
| 15 | * @method static string getDefaultDriver() |
| 16 | * @method static void setDefaultDriver(string $name) |
| 17 | * @method static \Illuminate\Cache\CacheManager forgetDriver(array|string|null $name = null) |
| 18 | * @method static void purge(string|null $name = null) |
| 19 | * @method static \Illuminate\Cache\CacheManager extend(string $driver, \Closure $callback) |
| 20 | * @method static \Illuminate\Cache\CacheManager setApplication(\Illuminate\Contracts\Foundation\Application $app) |
| 21 | * @method static bool has(\UnitEnum|array|string $key) |
| 22 | * @method static bool missing(\UnitEnum|string $key) |
| 23 | * @method static mixed get(\UnitEnum|array|string $key, mixed $default = null) |
| 24 | * @method static array many(array $keys) |
| 25 | * @method static iterable getMultiple(iterable $keys, mixed $default = null) |
| 26 | * @method static mixed pull(\UnitEnum|array|string $key, mixed $default = null) |
| 27 | * @method static string string(\UnitEnum|string $key, \Closure|string|null $default = null) |
| 28 | * @method static int integer(\UnitEnum|string $key, \Closure|int|null $default = null) |
| 29 | * @method static float float(\UnitEnum|string $key, \Closure|float|null $default = null) |
| 30 | * @method static bool boolean(\UnitEnum|string $key, \Closure|bool|null $default = null) |
| 31 | * @method static array array(\UnitEnum|string $key, \Closure|array|null $default = null) |
| 32 | * @method static bool put(\UnitEnum|array|string $key, mixed $value, \DateTimeInterface|\DateInterval|int|null $ttl = null) |
| 33 | * @method static bool set(\UnitEnum|array|string $key, mixed $value, \DateTimeInterface|\DateInterval|int|null $ttl = null) |
| 34 | * @method static bool putMany(array $values, \DateTimeInterface|\DateInterval|int|null $ttl = null) |
| 35 | * @method static bool setMultiple(iterable $values, null|int|\DateInterval $ttl = null) |
| 36 | * @method static bool add(\UnitEnum|array|string $key, mixed $value, \DateTimeInterface|\DateInterval|int|null $ttl = null) |
| 37 | * @method static int|bool increment(\UnitEnum|string $key, mixed $value = 1) |
| 38 | * @method static int|bool decrement(\UnitEnum|string $key, mixed $value = 1) |
| 39 | * @method static bool forever(\UnitEnum|string $key, mixed $value) |
| 40 | * @method static mixed remember(\UnitEnum|string $key, \Closure|\DateTimeInterface|\DateInterval|int|null $ttl, \Closure $callback) |
| 41 | * @method static mixed sear(\UnitEnum|string $key, \Closure $callback) |
| 42 | * @method static mixed rememberForever(\UnitEnum|string $key, \Closure $callback) |
| 43 | * @method static mixed flexible(\UnitEnum|string $key, array $ttl, callable $callback, array|null $lock = null, bool $alwaysDefer = false) |
| 44 | * @method static mixed withoutOverlapping(\UnitEnum|string $key, callable $callback, int $lockFor = 0, int $waitFor = 10, string|null $owner = null) |
| 45 | * @method static \Illuminate\Cache\Limiters\ConcurrencyLimiterBuilder funnel(\UnitEnum|string $name) |
| 46 | * @method static bool forget(\UnitEnum|array|string $key) |
| 47 | * @method static bool delete(\UnitEnum|array|string $key) |
| 48 | * @method static bool deleteMultiple(iterable $keys) |
| 49 | * @method static bool clear() |
| 50 | * @method static \Illuminate\Cache\TaggedCache tags(mixed $names) |
| 51 | * @method static string|null getName() |
| 52 | * @method static bool supportsTags() |
| 53 | * @method static int|null getDefaultCacheTime() |
| 54 | * @method static \Illuminate\Cache\Repository setDefaultCacheTime(int|null $seconds) |
| 55 | * @method static \Illuminate\Contracts\Cache\Store getStore() |
| 56 | * @method static \Illuminate\Cache\Repository setStore(\Illuminate\Contracts\Cache\Store $store) |
| 57 | * @method static \Illuminate\Contracts\Events\Dispatcher|null getEventDispatcher() |
| 58 | * @method static void setEventDispatcher(\Illuminate\Contracts\Events\Dispatcher $events) |
| 59 | * @method static void macro(string $name, object|callable $macro) |
| 60 | * @method static void mixin(object $mixin, bool $replace = true) |
| 61 | * @method static bool hasMacro(string $name) |
| 62 | * @method static void flushMacros() |
| 63 | * @method static mixed macroCall(string $method, array $parameters) |
| 64 | * @method static bool flush() |
| 65 | * @method static string getPrefix() |
| 66 | * @method static \Illuminate\Contracts\Cache\Lock lock(string $name, int $seconds = 0, string|null $owner = null) |
| 67 | * @method static \Illuminate\Contracts\Cache\Lock restoreLock(string $name, string $owner) |
| 68 | * |
| 69 | * @see \Illuminate\Cache\CacheManager |
| 70 | * @see \Illuminate\Cache\Repository |
| 71 | */ |
| 72 | class Cache extends Facade |
| 73 | { |
| 74 | /** |
| 75 | * Get the registered name of the component. |
| 76 | * |
| 77 | * @return string |
| 78 | */ |
| 79 | protected static function getFacadeAccessor() |
| 80 | { |
| 81 | return 'cache'; |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * Convert the facade into a Mockery spy. |
| 86 | * |
| 87 | * @return \Mockery\MockInterface |
| 88 | */ |
| 89 | public static function spy() |
| 90 | { |
| 91 | if (! static::isMock()) { |
| 92 | $class = static::getMockableClass(); |
| 93 | $instance = static::getFacadeRoot(); |
| 94 | |
| 95 | if ($class && $instance) { |
| 96 | return tap(Mockery::spy($instance)->makePartial(), function ($spy) { |
| 97 | static::swap($spy); |
| 98 | }); |
| 99 | } |
| 100 | |
| 101 | return tap($class ? Mockery::spy($class) : Mockery::spy(), function ($spy) { |
| 102 | static::swap($spy); |
| 103 | }); |
| 104 | } |
| 105 | } |
| 106 | } |