Provide Capabilities
as a read-only class
#308
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This also removes
capability
event and themarker
object. Capabilities are meant to be read-only and thus won't change after retrieval viaStorageInterface#getCapabilties
. By having the event deleted, there is no need to have the adapter injected, though we also removedCapabilities#getAdapter
and theStorageInterface
constructor argument.By refactoring the
Serializer
plugin, which already replaced the initial instance ofCapabilities
, we were able to drop thebase capabilities
feature as well.Final result is that we now provide all capabilities as public
read-only
properties which reflect their defaults which were previously handled via internal$default
magic inCapabilties#getCapability
.Along all the refactoring, some capabilities have changed or were removed while respecting ideas of #8 which was around since 2016:
staticTtl
got removed without a replacement. It outlined if the cache backend is handling cache expiry or if the implementation is taking care of it. Though it might be interesting for picking a specific backend, that is rather not of interest at runtime for upstream projects.lockOnExpire
got removed without a replacement. Was only used in zend-server adapter which is already abandoned since 2022minTtl
got renamed tottlSupported
and its type changed fromint
tobool
maxTtl
got removed without a replacement. Every cache backend which is supported by laminas right now does allow TTLs being an infinite amount of seconds (where maximumint
range is the limit, depending on the CPU architecture). There was a backendXCache
where a limit existed but that backend was abandoned in 2021.useRequestTime
was renamed tousesRequestTime
namespaceSeparator
got removed without a replacement. It was reflecting the option value and this the storage options can be used instead.closes #8