Skip to content

[Cache] Add information about clock parameter in ArrayAdapter #20070

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion components/cache/adapters/array_cache_adapter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,10 @@ method::

// the maximum number of items that can be stored in the cache. When the limit
// is reached, cache follows the LRU model (least recently used items are deleted)
$maxItems = 0
$maxItems = 0,

// implementation of Psr\Clock\ClockInterface (e.g. Symfony\Component\Clock\Clock)
// or null. If clock is provided, cache items lifetime will be calculated
// based on time provided by this clock
$clock = null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would shorten it a bit like this:

// optional implementation of the Psr\Clock\ClockInterface that will be used
// to calculate the lifetime of cache items (for example to get predictable
// lifetimes in tests)
$clock = null,

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this matches better the style of the existing docs, so I changed the original text by this while merging. Thanks.

);
Loading