BoundedOrderedMap
class BoundedOrderedMap
| internal |
Methods
__construct(int $capacity, callable|null $evictionCallback = null)
Create a bounded map with an optional eviction callback.
void
set(string $key, mixed $value)
Store a value, evicting the oldest entry when necessary.
mixed
get(string $key)
Return a value by key.
mixed
pull(string $key)
Remove and return a value by key.
newestFirst()
Yield entries from newest to oldest.
Details
at line 33
__construct(int $capacity, callable|null $evictionCallback = null)
Create a bounded map with an optional eviction callback.
at line 47
void
set(string $key, mixed $value)
Store a value, evicting the oldest entry when necessary.
at line 67
mixed
get(string $key)
Return a value by key.
at line 77
mixed
pull(string $key)
Remove and return a value by key.
at line 94
Generator
newestFirst()
Yield entries from newest to oldest.