class Cache extends Facade

Properties

static protected Container|null $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 MockInterface|null
spy()

Initiate a spy on the cache facade.

static MockInterface
partialMock()

Initiate a partial mock on the facade.

from  Facade
static CompositeExpectation|Expectation|HigherOrderMessage
shouldReceive()

Initiate a mock expectation on the facade.

from  Facade
static CompositeExpectation|Expectation|ExpectsHigherOrderMessage
expects()

Initiate a mock expectation on the facade.

from  Facade
static MockInterface
createFreshMockInstance()

Create a fresh mock instance for the given class.

from  Facade
static MockInterface
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 void
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 Container|null
getFacadeApplication()

Get the application instance behind the facade.

from  Facade
static void
setFacadeApplication(Container|null $app)

Set the application instance.

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

Handle dynamic, static calls to the object.

from  Facade
static CacheManager
allowSerializableClassesUsing(Closure $resolver)

No description

static Repository
build(array $config)

No description

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

No description

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

No description

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

No description

static string
getDefaultDriver()

No description

static void
handleUnserializableClassUsing(callable|null $callback)

No description

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

No description

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

No description

static void
refreshEventDispatcher()

No description

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

No description

static Repository
resolve(string $name)

No description

static CacheManager
setApplication(Container $app)

No description

static void
setDefaultDriver(UnitEnum|string $name)

No description

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

No description

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

No description

static void
array()

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

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

No description

static bool
clear()

No description

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

No description

static bool
delete(UnitEnum|string $key)

No description

static bool
deleteMultiple(UnitEnum> $keys)

No description

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 float
float(UnitEnum|string $key, Closure|float $default = 'null')

No description

static bool
flushLocks()

No description

static void
flushMacros()

No description

static void
flushState()

No description

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

No description

static bool
forget(UnitEnum|array|string $key)

No description

funnel(UnitEnum|string $name)

No description

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

No description

static int|null
getDefaultCacheTime()

No description

static Dispatcher|null
getEventDispatcher()

No description

static void
iterable()

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

static string|null
getName()

No description

static Store
getStore()

No description

static bool
has(UnitEnum|array|string $key)

No description

static bool
hasMacro(string $name)

No description

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

No description

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

No description

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

No description

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

No description

static array
many(array $keys)

No description

static bool
missing(UnitEnum|string $key)

No description

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

No description

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

No description

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

No description

static bool
putMany(array $values, DateTimeInterface|int|null $ttl = 'null')

No description

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

No description

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

No description

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

No description

static mixed
rememberNullable(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
searNullable(UnitEnum|string $key, Closure $callback)

No description

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

No description

static Repository
setDefaultCacheTime(int|null $seconds)

No description

static void
setEventDispatcher(Dispatcher $events)

No description

static bool
setMultiple(iterable $values, DateTimeInterface|int|null $ttl = 'null')

No description

static Repository
setStore(Store $store)

No description

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

No description

static bool
supportsFlushingLocks()

No description

static bool
supportsTags()

No description

static TaggedCache
tags(mixed $names)

No description

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

No description

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

No description

static bool
flush()

No description

static string
getPrefix()

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 TagMode
getTagMode()

No description

Details

in Facade at line 61
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 97
static MockInterface|null 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.

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

Return Value

MockInterface|null

in Facade at line 99
static MockInterface partialMock()

Initiate a partial mock on the facade.

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

Return Value

MockInterface

in Facade at line 115
static CompositeExpectation|Expectation|HigherOrderMessage shouldReceive()

Initiate a mock expectation on the facade.

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

Return Value

CompositeExpectation|Expectation|HigherOrderMessage

in Facade at line 131
static CompositeExpectation|Expectation|ExpectsHigherOrderMessage expects()

Initiate a mock expectation on the facade.

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

Return Value

CompositeExpectation|Expectation|ExpectsHigherOrderMessage

in Facade at line 145
static protected MockInterface createFreshMockInstance()

Create a fresh mock instance for the given class.

Return Value

MockInterface

in Facade at line 157
static protected MockInterface createMock()

Create a fresh mock instance for the given class.

Return Value

MockInterface

in Facade at line 167
static protected bool isMock()

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

Return Value

bool

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

Get the mockable class for the bound instance.

Return Value

string|null

in Facade at line 194
static void 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

Return Value

void

in Facade at line 206
static bool isFake()

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

Return Value

bool

in Facade at line 217
static mixed getFacadeRoot()

Get the root object behind the facade.

Return Value

mixed

at line 120
static protected string getFacadeAccessor()

Get the registered name of the component.

Return Value

string

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

Resolve the facade root instance from the container.

Parameters

string $name

Return Value

mixed

in Facade at line 256
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 267
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 275
static Collection defaultAliases()

Get the application default aliases.

Return Value

Collection

in Facade at line 335
static Container|null getFacadeApplication()

Get the application instance behind the facade.

Return Value

Container|null

in Facade at line 346
static void setFacadeApplication(Container|null $app)

Set the application instance.

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

Parameters

Container|null $app

Return Value

void

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

Handle dynamic, static calls to the object.

Parameters

string $method
array $args

Return Value

mixed

Exceptions

RuntimeException

at line 87
static CacheManager allowSerializableClassesUsing(Closure $resolver)

No description

Parameters

Closure $resolver

Return Value

CacheManager

at line 87
static Repository build(array $config)

No description

Parameters

array $config

Return Value

Repository

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

No description

Parameters

UnitEnum|string|null $driver

Return Value

Repository

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

No description

Parameters

string $driver
Closure $callback

Return Value

CacheManager

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

No description

Parameters

UnitEnum|array|string|null $name

Return Value

CacheManager

at line 87
static string getDefaultDriver()

No description

Return Value

string

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

No description

Parameters

callable|null $callback

Return Value

void

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

No description

Parameters

UnitEnum|string|null $driver

Return Value

Repository

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

No description

Parameters

UnitEnum|string|null $name

Return Value

void

at line 87
static void refreshEventDispatcher()

No description

Return Value

void

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

No description

Parameters

Store $store
array $config

Return Value

Repository

at line 87
static Repository resolve(string $name)

No description

Parameters

string $name

Return Value

Repository

at line 87
static CacheManager setApplication(Container $app)

No description

Parameters

Container $app

Return Value

CacheManager

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

No description

Parameters

UnitEnum|string $name

Return Value

void

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

No description

Parameters

UnitEnum|string|null $name

Return Value

Repository

at line 87
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 87
static void array()

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

Return Value

void

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

No description

Parameters

UnitEnum|string $key
Closure $default

Return Value

bool

at line 87
static bool clear()

No description

Return Value

bool

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

No description

Parameters

UnitEnum|string $key
int $value

Return Value

int|bool

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

No description

Parameters

UnitEnum|string $key

Return Value

bool

at line 87
static bool deleteMultiple(UnitEnum> $keys)

No description

Parameters

UnitEnum> $keys

Return Value

bool

at line 87
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 87
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 87
static float float(UnitEnum|string $key, Closure|float $default = 'null')

No description

Parameters

UnitEnum|string $key
Closure|float $default

Return Value

float

at line 87
static bool flushLocks()

No description

Return Value

bool

at line 87
static void flushMacros()

No description

Return Value

void

at line 87
static void flushState()

No description

Return Value

void

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

No description

Parameters

UnitEnum|string $key
mixed $value

Return Value

bool

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

No description

Parameters

UnitEnum|array|string $key

Return Value

bool

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

No description

Parameters

UnitEnum|string $name

Return Value

ConcurrencyLimiterBuilder

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

No description

Parameters

UnitEnum|array|string $key
mixed $default

Return Value

mixed

at line 87
static int|null getDefaultCacheTime()

No description

Return Value

int|null

at line 87
static Dispatcher|null getEventDispatcher()

No description

Return Value

Dispatcher|null

at line 87
static void iterable()

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

Return Value

void

at line 87
static string|null getName()

No description

Return Value

string|null

at line 87
static Store getStore()

No description

Return Value

Store

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

No description

Parameters

UnitEnum|array|string $key

Return Value

bool

at line 87
static bool hasMacro(string $name)

No description

Parameters

string $name

Return Value

bool

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

No description

Parameters

UnitEnum|string $key
int $value

Return Value

int|bool

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

No description

Parameters

UnitEnum|string $key
Closure|int $default

Return Value

int

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

No description

Parameters

string $name
callable|object $macro

Return Value

void

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

No description

Parameters

string $method
array $parameters

Return Value

mixed

at line 87
static array many(array $keys)

No description

Parameters

array $keys

Return Value

array

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

No description

Parameters

UnitEnum|string $key

Return Value

bool

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

No description

Parameters

object $mixin
bool $replace

Return Value

void

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

No description

Parameters

UnitEnum|string $key
mixed $default

Return Value

mixed

at line 87
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 87
static bool putMany(array $values, DateTimeInterface|int|null $ttl = 'null')

No description

Parameters

array $values
DateTimeInterface|int|null $ttl

Return Value

bool

at line 87
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 87
static mixed rememberForever(UnitEnum|string $key, Closure $callback)

No description

Parameters

UnitEnum|string $key
Closure $callback

Return Value

mixed

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

No description

Parameters

UnitEnum|string $key
Closure $callback

Return Value

mixed

at line 87
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 87
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 87
static mixed sear(UnitEnum|string $key, Closure $callback)

No description

Parameters

UnitEnum|string $key
Closure $callback

Return Value

mixed

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

No description

Parameters

UnitEnum|string $key
Closure $callback

Return Value

mixed

at line 87
static bool set(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 87
static Repository setDefaultCacheTime(int|null $seconds)

No description

Parameters

int|null $seconds

Return Value

Repository

at line 87
static void setEventDispatcher(Dispatcher $events)

No description

Parameters

Dispatcher $events

Return Value

void

at line 87
static bool setMultiple(iterable $values, DateTimeInterface|int|null $ttl = 'null')

No description

Parameters

iterable $values
DateTimeInterface|int|null $ttl

Return Value

bool

at line 87
static Repository setStore(Store $store)

No description

Parameters

Store $store

Return Value

Repository

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

No description

Parameters

UnitEnum|string $key
Closure|string $default

Return Value

string

at line 87
static bool supportsFlushingLocks()

No description

Return Value

bool

at line 87
static bool supportsTags()

No description

Return Value

bool

at line 87
static TaggedCache tags(mixed $names)

No description

Parameters

mixed $names

Return Value

TaggedCache

at line 87
static bool touch(UnitEnum|string $key, DateTimeInterface|int $ttl)

No description

Parameters

UnitEnum|string $key
DateTimeInterface|int $ttl

Return Value

bool

at line 87
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 87
static bool flush()

No description

Return Value

bool

at line 87
static string getPrefix()

No description

Return Value

string

at line 87
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 87
static Lock restoreLock(string $name, string $owner)

No description

Parameters

string $name
string $owner

Return Value

Lock

at line 87
static TagMode getTagMode()

No description

Return Value

TagMode