Contribution Date
Technology
Contribution Project
Contribution Details
I really like the idea and was waiting for it ever since I used it in Laravel. I also like how this is done with traits that can just be use
d in contrib modules.
Few points for review:
- The comment block on
CacheRememberInterface
is incorrect. - I'd want this to be eventually added to the
CacheBackendInterface
in Drupal 9. Can we add a todo item for that? - I'd want to follow the signature of
set
method inremember
methods as well. Currently, it is$cid, $data, $expire, $tags
, but the remember method is$cid, $expire, $callback, $tags
. I realize you might have done it because $callback is a closure but I'd like to consider keeping the signature along the same pattern anyway, even if code appears like this:$data = $this->cache->remember($cid, function () { return 'My expensive value'; }, $expire);
This is not unprecedented, BTW. Functions like
array_map
are written similarly. - Can we use the phrase "Helper method" instead of "Shortcut" in docblocks for
remember
andrememberPermanent
methods.
Contribution Issue Link
Contribution Link
Files count
0
Patches count
0