[11.x] Add correct method documentation for "CacheableDependencyTrait" and "RefinableCacheableDependencyTrait"

Created on 8 May 2023, about 1 year ago
Updated 9 May 2023, about 1 year ago

Problem/Motivation

Currently, the function doc of "addCacheableDependency()" inside "/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php" is defined as follows:

/**
* {@inheritdoc}
*/

This doc comment states, that the "parent" trait "CacheableDependencyTrait" defines an identical named function with a doc comment which states, what the function does. Unfortunately, "CacheableDependencyTrait" does not implement "addCacheableDependency()" and therefore does not present a function doc.

This is the Case for SEVERAL functions declared inside "RefinableCacheableDependencyTrait" as well as "CacheableDependencyTrait". These important methods should be documented!

Steps to reproduce

Proposed resolution

Document:

  • addCacheableDependency
  • addCacheContexts
  • addCacheTags
  • mergeCacheMaxAge

Inside "/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php"

and

  • getCacheTags
  • getCacheContexts
  • getCacheMaxAge

Inside "web/core/lib/Drupal/Core/Cache/CacheableDependencyTrait.php".

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Closed: works as designed

Version

11.0 πŸ”₯

Component
CacheΒ  β†’

Last updated about 2 hours ago

Created by

πŸ‡©πŸ‡ͺGermany Grevil

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024