laminas / laminas-cache

Caching implementation with a variety of storage options, as well as codified caching strategies for callbacks, classes, and output
https://docs.laminas.dev/laminas-cache/
BSD 3-Clause "New" or "Revised" License
99 stars 51 forks source link

Provide `Capabilities` as a read-only class #308

Closed boesing closed 3 months ago

boesing commented 3 months ago
Q A
Documentation yes
BC Break yes
QA yes

Description

This also removes capability event and the marker object. Capabilities are meant to be read-only and thus won't change after retrieval via StorageInterface#getCapabilties. By having the event deleted, there is no need to have the adapter injected, though we also removed Capabilities#getAdapter and the StorageInterface constructor argument.

By refactoring the Serializer plugin, which already replaced the initial instance of Capabilities, we were able to drop the base 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 in Capabilties#getCapability.

Along all the refactoring, some capabilities have changed or were removed while respecting ideas of #8 which was around since 2016:

closes #8