final class NullCacheItemPool implements CacheItemPoolInterface (View source)

Implements a validating PSR-6 sink where reads always miss and mutations always succeed.

No cache values or deferred operations are retained.

Methods

CacheItemInterface
getItem(string $key)

Returns a new miss item for every valid key.

CacheItemInterface
iterable
getItems(array $keys = [])

Returns new miss items keyed by their original cache keys.

iterable
bool
hasItem(string $key)

Validates the key and always reports that no entry exists.

bool
bool
clear()

Succeeds without retaining or removing any state.

bool
bool
deleteItem(string $key)

Validates one key and succeeds without retaining state.

bool
bool
deleteItems(array $keys)

Validates every key and succeeds without retaining state.

bool
bool
save(CacheItemInterface $item)

Validates the item key and discards its value.

bool
bool
saveDeferred(CacheItemInterface $item)

Validates the item key and discards the deferred operation.

bool
bool
commit()

Succeeds because this pool never retains deferred operations.

bool

Details

getItem

CacheItemInterface getItem(string $key)

Returns a new miss item for every valid key.

Parameters

string $key

Return Value

CacheItemInterface

Exceptions

InvalidCacheKeyException

getItems

iterable getItems(array $keys = [])

Returns new miss items keyed by their original cache keys.

Parameters

array $keys

Return Value

iterable

Exceptions

InvalidCacheKeyException

hasItem

bool hasItem(string $key)

Validates the key and always reports that no entry exists.

Parameters

string $key

Return Value

bool

Exceptions

InvalidCacheKeyException

clear

bool clear()

Succeeds without retaining or removing any state.

Return Value

bool

deleteItem

bool deleteItem(string $key)

Validates one key and succeeds without retaining state.

Parameters

string $key

Return Value

bool

Exceptions

InvalidCacheKeyException

deleteItems

bool deleteItems(array $keys)

Validates every key and succeeds without retaining state.

Parameters

array $keys

Return Value

bool

Exceptions

InvalidCacheKeyException

save

bool save(CacheItemInterface $item)

Validates the item key and discards its value.

Parameters

CacheItemInterface $item

Return Value

bool

Exceptions

InvalidCacheKeyException

saveDeferred

bool saveDeferred(CacheItemInterface $item)

Validates the item key and discards the deferred operation.

Parameters

CacheItemInterface $item

Return Value

bool

Exceptions

InvalidCacheKeyException

commit

bool commit()

Succeeds because this pool never retains deferred operations.

Return Value

bool