Class: NullCache
Full name: Azera\Cache\NullCache
No-op cache that stores nothing and always reports a miss.
This is the default cache returned by AppContext::cache()
when no concrete cache has been registered. It allows calling code to
safely use $ctx->cache()->get('key', $default) and always receive
the default, without null-checks.
Public methods
get() ·
public function get(string $key, mixed $default = null): mixed
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$key |
string | - | |
$default |
mixed | null |
Return value
- Type:
mixed
set() ·
public function set(string $key, mixed $value, DateInterval|int|null $ttl = null): bool
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$key |
string | - | |
$value |
mixed | - | |
$ttl |
DateInterval|int|null | null |
Return value
- Type:
bool
delete() ·
public function delete(string $key): bool
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$key |
string | - |
Return value
- Type:
bool
clear() ·
public function clear(): bool
Return value
- Type:
bool
getMultiple() ·
public function getMultiple(iterable $keys, mixed $default = null): iterable
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$keys |
iterable | - | |
$default |
mixed | null |
Return value
- Type:
iterable
setMultiple() ·
public function setMultiple(iterable $values, DateInterval|int|null $ttl = null): bool
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$values |
iterable | - | |
$ttl |
DateInterval|int|null | null |
Return value
- Type:
bool
deleteMultiple() ·
public function deleteMultiple(iterable $keys): bool
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$keys |
iterable | - |
Return value
- Type:
bool
has() ·
public function has(string $key): bool
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$key |
string | - |
Return value
- Type:
bool