Skip to content

4.0.0

Closed Jun 16, 2024 100% complete

laminas-cache 4.0.0 is here and finally adds native types everywhere, adds support for psr/cache and psr/simple-cache v2 & v3 and introduces an all new metadata logic which allows adapters to provide metadata they actually support.

Please read more on how to migrate your project in our migration guideline.

Added

  • Every adapter which supports metadata now …

laminas-cache 4.0.0 is here and finally adds native types everywhere, adds support for psr/cache and psr/simple-cache v2 & v3 and introduces an all new metadata logic which allows adapters to provide metadata they actually support.

Please read more on how to migrate your project in our migration guideline.

Added

  • Every adapter which supports metadata now implements MetadataCapableInterface and provides a dedicated object containing all the metadata values it supports
  • Adds support for psr/cache and psr/simple-cache v2 & v3

Removed

  • supportedMetadata capability from Capabilities
  • KeyListIterator::CURRENT_AS_METADATA mode along with Laminas\Cache\Exception\MissingKeyException
  • automatic instantiation of SerializerInterface when calling PluginOptions#getSerializer
  • Increment and decrement feature from StorageInterface, so there is no more StorageInterface#incrementItem, StorageInterface#decrementItem, StorageInterface#decrementItems and StorageInterface#incrementItems
    • this also removes incrementItem, incrementItems, decrementItem, derementItems events (pre, post and exception)
  • dependency inversion on virtual package laminas/laminas-cache-storage-adapter-implementation which now allows laminas-cache to be required without a concrete storage adapter implementation
  • removed support for psr/cache and psr/simple-cache v1

Breaking Changes

  • AbstractAdapter and StorageInterface are not aware of the methods getMetadata anymore. These were moved to the new MetadataCapableInterface
  • Capabilities do not provide supportedMetadata anymore. The supported metadata is tied to the used storage adapter and thus, was already requiring projects to explicitly know the exact implementation of the cache backend in case of using these metadatas anyway
  • KeyListIterator and the corresponding IteratorInterface does not provide the mode CURRENT_AS_METADATA anymore
  • PluginOptions#getSerializer does not create a serializer anymore if a string option was passed, instead, the string is returned
  • Increment and decrement feature was removed from StorageInterface, so there is no more StorageInterface#incrementItem, StorageInterface#decrementItem, StorageInterface#decrementItems and StorageInterface#incrementItems
    • this also removes incrementItem, incrementItems, decrementItem, derementItems events (pre, post and exception)
  • Every method now has native return types
  • Every property now has native types
  • Every method argument now has native types
  • ObjectCache does not inherit the CallbackCache pattern anymore

This milestone is closed.

No open issues remain. View closed issues or see open milestones in this repository.