Add an interface for CacheableMetadata and replace type-hints of RefineableCacheableDependencyInterface with references to it instead

Created on 25 February 2022, over 2 years ago
Updated 13 February 2023, over 1 year ago

Problem/Motivation

hook_menu_local_tasks_alter() typehints the cacheability parameter as \Drupal\Core\Cache\RefinableCacheableDependencyInterface, but it's actually an instance of \Drupal\Core\Cache\CacheableMetadata which has far more methods (e.g. merge()).

Steps to reproduce

Proposed resolution

  • Add a new interface for the public methods on CacheableMetadata
  • Have this interface extend RefineableCacheableDepenencyInterface
  • Have CacheableMetadata implement this new interface
  • Change the type-hint in the relevant code to use the new interface, for example hook_menu_local_tasks_alter()

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Needs work

Version

10.0 ✨

Component
Menu systemΒ  β†’

Last updated about 21 hours ago

Created by

πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024