class Cache extends Facade

Properties

static protected $app

The application instance being facaded.

from  Facade
static protected array $resolvedInstance

The resolved object instances.

from  Facade
static protected bool $cached

Indicates if the resolved instance should be cached.

from  Facade

Methods

static void
resolved(Closure $callback)

Run a Closure when the facade has been resolved.

from  Facade
static 
spy()

Initiate a spy on the cache facade.

static 
partialMock()

Initiate a partial mock on the facade.

from  Facade
static 
shouldReceive()

Initiate a mock expectation on the facade.

from  Facade
static 
expects()

Initiate a mock expectation on the facade.

from  Facade
static 
createFreshMockInstance()

Create a fresh mock instance for the given class.

from  Facade
static 
createMock()

Create a fresh mock instance for the given class.

from  Facade
static bool
isMock()

Determines whether a mock is set as the instance of the facade.

from  Facade
static string|null
getMockableClass()

Get the mockable class for the bound instance.

from  Facade
static 
swap(mixed $instance)

Hotswap the underlying instance behind the facade.

from  Facade
static bool
isFake()

Determines whether a "fake" has been set as the facade instance.

from  Facade
static mixed
getFacadeRoot()

Get the root object behind the facade.

from  Facade
static string
getFacadeAccessor()

Get the registered name of the component.

static mixed
resolveFacadeInstance(string $name)

Resolve the facade root instance from the container.

from  Facade
static void
clearResolvedInstance(string|null $name = null)

Clear a resolved facade instance.

from  Facade
static void
clearResolvedInstances()

Clear all of the resolved instances.

from  Facade
static Collection
defaultAliases()

Get the application default aliases.

from  Facade
static 
getFacadeApplication()

Get the application instance behind the facade.

from  Facade
static void
setFacadeApplication(mixed $app)

Set the application instance.

from  Facade
static 
__callStatic(string $method, array $args)

Handle dynamic, static calls to the object.

from  Facade
static Repository
store(UnitEnum|string|null $name = 'null')

No description

static Repository
driver(UnitEnum|string|null $driver = 'null')

No description

static Repository
memo(UnitEnum|string|null $driver = 'null')

No description

static Repository
resolve(string $name)

No description

static Repository
build(array $config)

No description

static Repository
repository(Store $store, array $config = '[]')

No description

static void
refreshEventDispatcher()

No description

static string
getDefaultDriver()

No description

static void
setDefaultDriver(UnitEnum|string $name)

No description

static CacheManager
forgetDriver(UnitEnum|string|null $name = 'null')

No description

static void
purge(UnitEnum|string|null $name = 'null')

No description

static CacheManager
extend(string $driver, Closure $callback)

No description

static CacheManager
setApplication(Container $app)

No description

static void
handleUnserializableClassUsing(callable|null $callback)

No description

static CacheManager
allowSerializableClassesUsing(Closure $resolver)

No description

static mixed
pull(UnitEnum|string $key, Closure|mixed $default = 'null')

No description

static bool
put(UnitEnum|array|string $key, mixed $value, DateTimeInterface|int|null $ttl = 'null')

No description

static bool
add(UnitEnum|string $key, mixed $value, DateTimeInterface|int|null $ttl = 'null')

No description

static int|bool
increment(UnitEnum|string $key, int $value = '1')

No description

static int|bool
decrement(UnitEnum|string $key, int $value = '1')

No description

static bool
forever(UnitEnum|string $key, mixed $value)

No description

static mixed
remember(UnitEnum|string $key, DateTimeInterface|int|null $ttl, Closure $callback)

No description

static array
rememberWithWarmth(UnitEnum|string $key, DateTimeInterface|int|null $ttl, Closure $callback)

No description

static mixed
sear(UnitEnum|string $key, Closure $callback)

No description

static mixed
rememberForever(UnitEnum|string $key, Closure $callback)

No description

static mixed
rememberNullable(UnitEnum|string $key, DateTimeInterface|int|null $ttl, Closure $callback)

No description

static mixed
searNullable(UnitEnum|string $key, Closure $callback)

No description

static mixed
rememberForeverNullable(UnitEnum|string $key, Closure $callback)

No description

static bool
touch(UnitEnum|string $key, DateTimeInterface|int|null $ttl = 'null')

No description

static bool
forget(UnitEnum|string $key)

No description

static Store
getStore()

No description

static mixed
get(UnitEnum|string $key, mixed $default = 'null')

No description

static bool
set(UnitEnum|string $key, mixed $value, DateInterval $ttl = 'null')

No description

static bool
delete(UnitEnum|string $key)

No description

static bool
clear()

No description

static void
iterable()

<string, mixed> getMultiple(iterable<\UnitEnum|string> $keys, mixed $default = 'null')

static bool
setMultiple(iterable $values, DateInterval $ttl = 'null')

No description

static bool
deleteMultiple(UnitEnum|string> $keys)

No description

static bool
has(UnitEnum|string $key)

No description

static Lock
lock(string $name, int $seconds = '0', string|null $owner = 'null')

No description

static Lock
restoreLock(string $name, string $owner)

No description

static TaggedCache
tags(mixed $names)

No description

static TagMode
getTagMode()

No description

static array
many(array $keys)

No description

static bool
putMany(array $values, int $seconds)

No description

static bool
flush()

No description

static string
getPrefix()

No description

static bool
missing(UnitEnum|string $key)

No description

static string
string(UnitEnum|string $key, Closure|string $default = 'null')

No description

static int
integer(UnitEnum|string $key, Closure|int $default = 'null')

No description

static float
float(UnitEnum|string $key, Closure|float $default = 'null')

No description

static bool
boolean(UnitEnum|string $key, Closure $default = 'null')

No description

static void
array()

<array-key, mixed> array(\UnitEnum|string $key, null|array<array-key, mixed>|\Closure $default = 'null')

static mixed
flexible(UnitEnum|string $key, array $ttl, callable $callback, null|array $lock = 'null', bool $alwaysDefer = 'false')

No description

static mixed
flexibleNullable(UnitEnum|string $key, array $ttl, callable $callback, null|array $lock = 'null', bool $alwaysDefer = 'false')

No description

static mixed
withoutOverlapping(UnitEnum|string $key, callable $callback, int $lockFor = '0', int $waitFor = '10', string|null $owner = 'null')

No description

funnel(UnitEnum|string $name)

No description

static bool
flushLocks()

No description

static bool
supportsTags()

No description

static bool
supportsFlushingLocks()

No description

static int|null
getDefaultCacheTime()

No description

static Repository
setDefaultCacheTime(int|null $seconds)

No description

static Repository
setStore(Store $store)

No description

static Dispatcher|null
getEventDispatcher()

No description

static void
setEventDispatcher(Dispatcher $events)

No description

static string|null
getName()

No description

static void
flushState()

No description

static void
macro(string $name, callable|object $macro)

No description

static void
mixin(object $mixin, bool $replace = 'true')

No description

static bool
hasMacro(string $name)

No description

static void
flushMacros()

No description

static mixed
macroCall(string $method, array $parameters)

No description

Details

in Facade at line 55
static void resolved(Closure $callback)

Run a Closure when the facade has been resolved.

Boot-only. The callback is registered on the worker-global container and runs for every subsequent resolution of the facade accessor.

Parameters

Closure $callback

Return Value

void

at line 94
static spy()

Initiate a spy on the cache facade.

Uses a partial spy on the real instance so that methods like memo() execute their real implementation while still recording calls.

in Facade at line 89
static partialMock()

Initiate a partial mock on the facade.

Tests only. Swaps the resolved facade instance for the worker lifetime.

in Facade at line 105
static shouldReceive()

Initiate a mock expectation on the facade.

Tests only. Swaps the resolved facade instance for the worker lifetime.

in Facade at line 121
static expects()

Initiate a mock expectation on the facade.

Tests only. Swaps the resolved facade instance for the worker lifetime.

in Facade at line 135
static protected createFreshMockInstance()

Create a fresh mock instance for the given class.

in Facade at line 147
static protected createMock()

Create a fresh mock instance for the given class.

in Facade at line 157
static protected bool isMock()

Determines whether a mock is set as the instance of the facade.

Return Value

bool

in Facade at line 168
static protected string|null getMockableClass()

Get the mockable class for the bound instance.

Return Value

string|null

in Facade at line 184
static swap(mixed $instance)

Hotswap the underlying instance behind the facade.

Tests only. Replaces the worker-wide resolved facade instance and container binding; runtime use races across coroutines and changes every subsequent facade call.

Parameters

mixed $instance

in Facade at line 196
static bool isFake()

Determines whether a "fake" has been set as the facade instance.

Return Value

bool

in Facade at line 207
static mixed getFacadeRoot()

Get the root object behind the facade.

Return Value

mixed

at line 112
static protected string getFacadeAccessor()

Get the registered name of the component.

Return Value

string

in Facade at line 223
static protected mixed resolveFacadeInstance(string $name)

Resolve the facade root instance from the container.

Parameters

string $name

Return Value

mixed

in Facade at line 246
static void clearResolvedInstance(string|null $name = null)

Clear a resolved facade instance.

Boot or tests only. Clears a worker-wide facade cache entry; concurrent coroutines may still hold the previous resolved instance.

Parameters

string|null $name

Return Value

void

in Facade at line 257
static void clearResolvedInstances()

Clear all of the resolved instances.

Boot or tests only. Clears the worker-wide facade cache; concurrent coroutines may still hold previously resolved instances.

Return Value

void

in Facade at line 265
static Collection defaultAliases()

Get the application default aliases.

Return Value

Collection

in Facade at line 324
static getFacadeApplication()

Get the application instance behind the facade.

in Facade at line 337
static void setFacadeApplication(mixed $app)

Set the application instance.

Tests only. Replaces the worker-wide facade application reference; runtime use races across coroutines and breaks every facade lookup.

Parameters

mixed $app

Return Value

void

in Facade at line 347
static __callStatic(string $method, array $args)

Handle dynamic, static calls to the object.

Parameters

string $method
array $args

Exceptions

RuntimeException

at line 86
static Repository store(UnitEnum|string|null $name = 'null')

No description

Parameters

UnitEnum|string|null $name

Return Value

Repository

at line 86
static Repository driver(UnitEnum|string|null $driver = 'null')

No description

Parameters

UnitEnum|string|null $driver

Return Value

Repository

at line 86
static Repository memo(UnitEnum|string|null $driver = 'null')

No description

Parameters

UnitEnum|string|null $driver

Return Value

Repository

at line 86
static Repository resolve(string $name)

No description

Parameters

string $name

Return Value

Repository

at line 86
static Repository build(array $config)

No description

Parameters

array $config

Return Value

Repository

at line 86
static Repository repository(Store $store, array $config = '[]')

No description

Parameters

Store $store
array $config

Return Value

Repository

at line 86
static void refreshEventDispatcher()

No description

Return Value

void

at line 86
static string getDefaultDriver()

No description

Return Value

string

at line 86
static void setDefaultDriver(UnitEnum|string $name)

No description

Parameters

UnitEnum|string $name

Return Value

void

at line 86
static CacheManager forgetDriver(UnitEnum|string|null $name = 'null')

No description

Parameters

UnitEnum|string|null $name

Return Value

CacheManager

at line 86
static void purge(UnitEnum|string|null $name = 'null')

No description

Parameters

UnitEnum|string|null $name

Return Value

void

at line 86
static CacheManager extend(string $driver, Closure $callback)

No description

Parameters

string $driver
Closure $callback

Return Value

CacheManager

at line 86
static CacheManager setApplication(Container $app)

No description

Parameters

Container $app

Return Value

CacheManager

at line 86
static void handleUnserializableClassUsing(callable|null $callback)

No description

Parameters

callable|null $callback

Return Value

void

at line 86
static CacheManager allowSerializableClassesUsing(Closure $resolver)

No description

Parameters

Closure $resolver

Return Value

CacheManager

at line 86
static mixed pull(UnitEnum|string $key, Closure|mixed $default = 'null')

No description

Parameters

UnitEnum|string $key
Closure|mixed $default

Return Value

mixed

at line 86
static bool put(UnitEnum|array|string $key, mixed $value, DateTimeInterface|int|null $ttl = 'null')

No description

Parameters

UnitEnum|array|string $key
mixed $value
DateTimeInterface|int|null $ttl

Return Value

bool

at line 86
static bool add(UnitEnum|string $key, mixed $value, DateTimeInterface|int|null $ttl = 'null')

No description

Parameters

UnitEnum|string $key
mixed $value
DateTimeInterface|int|null $ttl

Return Value

bool

at line 86
static int|bool increment(UnitEnum|string $key, int $value = '1')

No description

Parameters

UnitEnum|string $key
int $value

Return Value

int|bool

at line 86
static int|bool decrement(UnitEnum|string $key, int $value = '1')

No description

Parameters

UnitEnum|string $key
int $value

Return Value

int|bool

at line 86
static bool forever(UnitEnum|string $key, mixed $value)

No description

Parameters

UnitEnum|string $key
mixed $value

Return Value

bool

at line 86
static mixed remember(UnitEnum|string $key, DateTimeInterface|int|null $ttl, Closure $callback)

No description

Parameters

UnitEnum|string $key
DateTimeInterface|int|null $ttl
Closure $callback

Return Value

mixed

at line 86
static array rememberWithWarmth(UnitEnum|string $key, DateTimeInterface|int|null $ttl, Closure $callback)

No description

Parameters

UnitEnum|string $key
DateTimeInterface|int|null $ttl
Closure $callback

Return Value

array

at line 86
static mixed sear(UnitEnum|string $key, Closure $callback)

No description

Parameters

UnitEnum|string $key
Closure $callback

Return Value

mixed

at line 86
static mixed rememberForever(UnitEnum|string $key, Closure $callback)

No description

Parameters

UnitEnum|string $key
Closure $callback

Return Value

mixed

at line 86
static mixed rememberNullable(UnitEnum|string $key, DateTimeInterface|int|null $ttl, Closure $callback)

No description

Parameters

UnitEnum|string $key
DateTimeInterface|int|null $ttl
Closure $callback

Return Value

mixed

at line 86
static mixed searNullable(UnitEnum|string $key, Closure $callback)

No description

Parameters

UnitEnum|string $key
Closure $callback

Return Value

mixed

at line 86
static mixed rememberForeverNullable(UnitEnum|string $key, Closure $callback)

No description

Parameters

UnitEnum|string $key
Closure $callback

Return Value

mixed

at line 86
static bool touch(UnitEnum|string $key, DateTimeInterface|int|null $ttl = 'null')

No description

Parameters

UnitEnum|string $key
DateTimeInterface|int|null $ttl

Return Value

bool

at line 86
static bool forget(UnitEnum|string $key)

No description

Parameters

UnitEnum|string $key

Return Value

bool

at line 86
static Store getStore()

No description

Return Value

Store

at line 86
static mixed get(UnitEnum|string $key, mixed $default = 'null')

No description

Parameters

UnitEnum|string $key
mixed $default

Return Value

mixed

at line 86
static bool set(UnitEnum|string $key, mixed $value, DateInterval $ttl = 'null')

No description

Parameters

UnitEnum|string $key
mixed $value
DateInterval $ttl

Return Value

bool

at line 86
static bool delete(UnitEnum|string $key)

No description

Parameters

UnitEnum|string $key

Return Value

bool

at line 86
static bool clear()

No description

Return Value

bool

at line 86
static void iterable()

<string, mixed> getMultiple(iterable<\UnitEnum|string> $keys, mixed $default = 'null')

Return Value

void

at line 86
static bool setMultiple(iterable $values, DateInterval $ttl = 'null')

No description

Parameters

iterable $values
DateInterval $ttl

Return Value

bool

at line 86
static bool deleteMultiple(UnitEnum|string> $keys)

No description

Parameters

UnitEnum|string> $keys

Return Value

bool

at line 86
static bool has(UnitEnum|string $key)

No description

Parameters

UnitEnum|string $key

Return Value

bool

at line 86
static Lock lock(string $name, int $seconds = '0', string|null $owner = 'null')

No description

Parameters

string $name
int $seconds
string|null $owner

Return Value

Lock

at line 86
static Lock restoreLock(string $name, string $owner)

No description

Parameters

string $name
string $owner

Return Value

Lock

at line 86
static TaggedCache tags(mixed $names)

No description

Parameters

mixed $names

Return Value

TaggedCache

at line 86
static TagMode getTagMode()

No description

Return Value

TagMode

at line 86
static array many(array $keys)

No description

Parameters

array $keys

Return Value

array

at line 86
static bool putMany(array $values, int $seconds)

No description

Parameters

array $values
int $seconds

Return Value

bool

at line 86
static bool flush()

No description

Return Value

bool

at line 86
static string getPrefix()

No description

Return Value

string

at line 86
static bool missing(UnitEnum|string $key)

No description

Parameters

UnitEnum|string $key

Return Value

bool

at line 86
static string string(UnitEnum|string $key, Closure|string $default = 'null')

No description

Parameters

UnitEnum|string $key
Closure|string $default

Return Value

string

at line 86
static int integer(UnitEnum|string $key, Closure|int $default = 'null')

No description

Parameters

UnitEnum|string $key
Closure|int $default

Return Value

int

at line 86
static float float(UnitEnum|string $key, Closure|float $default = 'null')

No description

Parameters

UnitEnum|string $key
Closure|float $default

Return Value

float

at line 86
static bool boolean(UnitEnum|string $key, Closure $default = 'null')

No description

Parameters

UnitEnum|string $key
Closure $default

Return Value

bool

at line 86
static void array()

<array-key, mixed> array(\UnitEnum|string $key, null|array<array-key, mixed>|\Closure $default = 'null')

Return Value

void

at line 86
static mixed flexible(UnitEnum|string $key, array $ttl, callable $callback, null|array $lock = 'null', bool $alwaysDefer = 'false')

No description

Parameters

UnitEnum|string $key
array $ttl
callable $callback
null|array $lock
bool $alwaysDefer

Return Value

mixed

at line 86
static mixed flexibleNullable(UnitEnum|string $key, array $ttl, callable $callback, null|array $lock = 'null', bool $alwaysDefer = 'false')

No description

Parameters

UnitEnum|string $key
array $ttl
callable $callback
null|array $lock
bool $alwaysDefer

Return Value

mixed

at line 86
static mixed withoutOverlapping(UnitEnum|string $key, callable $callback, int $lockFor = '0', int $waitFor = '10', string|null $owner = 'null')

No description

Parameters

UnitEnum|string $key
callable $callback
int $lockFor
int $waitFor
string|null $owner

Return Value

mixed

at line 86
static ConcurrencyLimiterBuilder funnel(UnitEnum|string $name)

No description

Parameters

UnitEnum|string $name

Return Value

ConcurrencyLimiterBuilder

at line 86
static bool flushLocks()

No description

Return Value

bool

at line 86
static bool supportsTags()

No description

Return Value

bool

at line 86
static bool supportsFlushingLocks()

No description

Return Value

bool

at line 86
static int|null getDefaultCacheTime()

No description

Return Value

int|null

at line 86
static Repository setDefaultCacheTime(int|null $seconds)

No description

Parameters

int|null $seconds

Return Value

Repository

at line 86
static Repository setStore(Store $store)

No description

Parameters

Store $store

Return Value

Repository

at line 86
static Dispatcher|null getEventDispatcher()

No description

Return Value

Dispatcher|null

at line 86
static void setEventDispatcher(Dispatcher $events)

No description

Parameters

Dispatcher $events

Return Value

void

at line 86
static string|null getName()

No description

Return Value

string|null

at line 86
static void flushState()

No description

Return Value

void

at line 86
static void macro(string $name, callable|object $macro)

No description

Parameters

string $name
callable|object $macro

Return Value

void

at line 86
static void mixin(object $mixin, bool $replace = 'true')

No description

Parameters

object $mixin
bool $replace

Return Value

void

at line 86
static bool hasMacro(string $name)

No description

Parameters

string $name

Return Value

bool

at line 86
static void flushMacros()

No description

Return Value

void

at line 86
static mixed macroCall(string $method, array $parameters)

No description

Parameters

string $method
array $parameters

Return Value

mixed