thesportsdb-client

InMemoryResponseCache
in package
implements ResponseCache, Countable

FinalYes

A bounded, per-process LRU cache with per-entry expiry.

Table of Contents

Interfaces

ResponseCache
Stores raw response bodies. Keys never contain an API key.
Countable

Properties

$clock  : callable(): float
$entries  : array<string, array{string, float}>
$maxEntries  : int

Methods

__construct()  : mixed
clear()  : void
count()  : int
get()  : string|null
keys()  : array<int, string>
put()  : void

Properties

Methods

__construct()

public __construct([int $maxEntries = 1000 ][, callable(): float|null $clock = null ]) : mixed
Parameters
$maxEntries : int = 1000
$clock : callable(): float|null = null

get()

public get(string $key) : string|null
Parameters
$key : string
Return values
string|null

put()

public put(string $key, string $body, float $ttl) : void
Parameters
$key : string
$body : string
$ttl : float
On this page

Search results